import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}
import scala.collection.mutable.Map
import scala.collection.mutable.Queue

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val N = in.next().toInt
  val A = new Array[Int](N+1)
  for (i <- 1 to N)
    A(i) = in.next().toInt

  //
  var ans = 0
  for (i <- 1 to N)
    if(i % 2 == 1)
      ans += A(i)
    else
      ans -= A(i)
  ans /= 2


  val memo = new Array[Int](N+1)
  val com = new Array[Int](N+1)
  memo(1) = ans
  memo(N) = ans
  com(1) = ans
  for (i <- 2 to N) {
    val tmp = A(i-1) - memo(i-1)
    com(i) = tmp
    memo(i-1) += tmp
    memo(i) += tmp
  }

  val res = A(N) - memo(N)
  Math.abs(res)

  pw.print(com(1)*2)
  for(i <- 2 to N)
    pw.print(s" ${com(i)*2}")
  pw.println
  pw.flush()
}


class InputReader(stream: InputStream) {
  private val reader = new BufferedReader(new InputStreamReader(stream))
  private var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}
