fun main(args: Array<String>) {
    var n = readInputLine().toInt()
    
    val aList = readInputLine().split(" ").map { it.toLong() }.toList().toLongArray()

    val sum = aList.sum()
    
    var x = aList.foldIndexed(sum, {i, a, e -> if (i % 2 == 1) a - e * 2 else a})
    
    print(x)
    print(" ")
    
    for (i in 1 until n) {
        x = aList[i - 1] * 2 - x
        print(x)
        if (i != n - 1) {
            print(" ")
        }
    }
}
 
fun readInputLine(): String {
    return readLine()!!
}
