#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
	int N;
	cin>>N;
	vector<int> p(N);
	vector<int> a(N);
	int tmp=-1;
	for(int i=0;i<N;i++){
		tmp*=-1;
		cin>>a[i];
		p[0]+=tmp*a[i];
	}
	p[0]/=2;
	cout<<p[0]*2<<' ';
	for(int i=0;i<N-1;i++){
		p[i+1]=a[i]-p[i];
		cout<<p[i+1]*2<<' ';
	}
	cout<<endl;
	
	return 0;
}