fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(' ').map(String::toInt)
    val x = Array(n) { 0 }
    x[1] = a.take(n - 1).sum() - a[n - 1]
    for (i in 1..(n - 3) / 2) {
        x[1] -= a[i * 2] * 2
    }
    x[0] = a[0] * 2 - x[1]
    for (i in 2 until n) {
        x[i] = a[i - 1] * 2 - x[i - 1]
    }
    println(x.joinToString(" "))
}
