#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
ll a[100005];
ll sum,zz;
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	cin>>a[i],sum+=a[i];
	for(int i=2;i<=n;i+=2)
	zz+=a[i];
	ll a1=sum-2*zz;
	cout<<a1<<" ";
	ll cur=a1/2;
	for(int i=2;i<=n;i++)
	{
		ll aa=a[i-1]-cur;
		cout<<2*aa<<" ";
		cur=aa;
	}
	cout<<endl;
}