fun main(args: Array<String>) {
//    val mod = 1000000007L
    val mod = 2019
    val N = readLine()!!.toInt()
    val A = readLine()!!.split(" ").map(String::toLong).toList()

    val S = A.sum()
    val X1 = S - 2 * (A.filterIndexed { id, l -> id % 2 == 1 }.sum())

    val list = mutableListOf(X1)
    var pre = X1
    for (n in 0 until N-1) {
        val tmp = 2*A[n] - pre
        pre = tmp
        list.add(tmp)
    }
        println(list.joinToString(" "))
}