fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val ds = readLine()!!.split(" ").map { it.toLong() }
    val sum = ds.sum()
    val subSum = (1..(n - 2) step 2).map { ds[it] }.sum() * 2L
    val xs = LongArray(n)
    xs[0] = sum - subSum
    for (i in 1 until n) {
        xs[i] = (ds[i - 1] - xs[i - 1] / 2) * 2
    }
    println(xs.joinToString(" "))
}