fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val aa = readLine()!!.split(" ").map { it.toLong() }

    val sumA = aa.sum()

    var ans1half = sumA/2
    for (i in 1 until n-1 step 2) {
        ans1half -= aa[i]
    }

    val ans = LongArray(n){0}
    ans[0] = ans1half

    for (i in 1 until n) {
        ans[i] = aa[i-1] - ans[i-1]
    }

    println(ans.map { it * 2 }.joinToString(separator = " "))
}