#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
	int N;
	vector<int> A;
	cin >> N;
	for(int i = 0;i < N;i++){
		int a;
		cin >> a;
		A.push_back(a);
	}

	int a=0;
	int p = 1;
	for(int j = 0; j < N; j++){
		a += A[j]*p;
		p *= -1;	
	}
	cout << a << endl;

	for(int j = 0; j < N-1; j++){
		a = 2*(A[j]-a/2);
		cout << a <<endl;
	}
}