fun main(args: Array<String>) {
    abc133d()
}

fun abc133d() {
    val n = readLine()!!.toInt()
    val dams = readLine()!!.split(" ").map { it.toLong() }.toLongArray()

    val rains = LongArray(n) { 0 }

    val loop = fun(i: Int): Int {
        return when {
            i > n - 1 -> i - n
            i < 0 -> i + n
            else -> i
        }
    }

    rains[0] = 0
    var index = 2
    while (index != 0) {
        rains[loop(index)] = dams[loop(index - 1)] * 2 - dams[loop(index - 2)] * 2 + rains[loop(index - 2)]
        index = loop(index + 2)
    }

    index = 1
    while (index != n - 2) {
        rains[loop(index)] = dams[loop(index - 1)] * 2 - dams[loop(index - 2)] * 2 + rains[loop(index - 2)]
        index = loop(index + 2)
    }

    val add = (dams.sum() - rains.sum()) / n

    (0 until n).forEach { rains[it] += add }

    println(rains.joinToString(" "))
}
