fun main(args: Array<String>) {
    val N = nextInt()
    val D = listOfLong()
    val S = D.sum()
    val Y = LongArray(N) { 0L }
    var x = 0L; for (n in 1..N - 1 step 2) x += D[n]
    Y[0] = S - x * 2
    for (n in 0 until N - 1) Y[n + 1] = 2 * D[n] - Y[n]
    println(Y.joinToString(separator = " "))
}
fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
fun listOfString() = next().split(" ")
fun listOfLong(delta: Long = 0L) = listOfString().map { it.toLong() + delta }
