object Main extends App {
	val N = scala.io.StdIn.readInt
	val b = scala.io.StdIn.readLine.split(" ").map(_.toInt)
	val a = new Array[Int](N)

	
	var tp = 0

	for(i<-0 until N){
		if(i%2 == 0) tp += b(i)
		else tp -= b(i)
	}

	a(0) = tp
	a(N-1) = 2*b(N-1) - a(0)

	for(i <- 1 until N-1){
		a(i) = 2*b(i-1) - a(i-1)
	}

	println(a.mkString(" "))



	
}