fun main(args: Array<String>) {
    val N = nextInt()
    val D = listOfLong()
    val X = LongArray(N)
    X[0] = D.reduceIndexed { n, acc, v -> if (n % 2 == 0) acc + v else acc - v }
    for (n in 0 until N - 1) X[n + 1] = 2 * D[n] - X[n]
    println(X.joinToString(separator = " "))
}
fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
fun listOfString() = next().split(" ")
fun listOfLong(delta: Long = 0) = listOfString().map { it.toLong() + delta }