import scala.io.StdIn

object Main {

  def main(args: Array[String]): Unit = {
    val n = StdIn.readInt
    val as = StdIn.readLine.split(' ').toSeq.map(_.toLong)
    val x0 = as.foldLeft(0l)((acc, a) => a - acc)
    val xs = as.foldLeft(Vector(x0))((acc, a) => acc :+ a * 2l - acc.last).dropRight(1)
    val output = xs.mkString(sep = " ")
    println(output)
  }

}
