fun main(args: Array<String>) {
    abc133d()
}

fun abc133d() {
    val n = readLine()!!.toInt()
    val dams = readLine()!!.split(" ").map { it.toLong() }.toLongArray()

    val rains = LongArray(n) { 0 }

    rains[0] = dams.sum() - dams.filterIndexed { index, l -> index % 2 != 0 }.sum() * 2

    for (i in 0 until n - 1) rains[i + 1] = dams[i] * 2 - rains[i]

    println(rains.joinToString(" "))
}
