fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
  val a = readLine()!!.split(" ").map(String::toLong)

  var x2 = 0L
  (0 until n).forEach { i -> x2 += if (i%2 == 0) a[i] else -a[i] }

  var ans = mutableListOf<Long>()
  ans.add(x2 / 2)
  (0 until n - 1).forEach { i -> ans.add(a[i] - ans[i]) }
  (0 until n).forEach { i -> ans[i] = ans[i] * 2 }
  println(ans.joinToString(" "))
}