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(Seq(x0))((acc, a) => acc :+ a * 2l - acc.last)
    for(i <- 0 until n) {
      print(s"${xs(i)} ")
    }
    println()
  }

}
