var AList: List<Int> = mutableListOf()
var N = 0
var cache = -1
fun main(args: Array<String>) {

    N = readLine()!!.split(" ").map { Integer.parseInt(it) }[0]
    AList = readLine()!!.split(" ").map { Integer.parseInt(it) }
    for (i in 0 until N) {
        print("${calc(i)} ")
    }

}

fun calc(start: Int): Int {
    var result = 0
    var sign = 1
    if (cache == -1) {
        for (i in start until N + start) {
            result += AList[i % N] * sign
            cache = result - AList[start]
            sign *= -1
        }
    } else {
        result = -1 * cache + AList[start - 1]
        cache = result - AList[start]
    }
    return result
}
