#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e5+5;
int n,sum,a[N],b[N],c[N];
signed main()
{
	cin>>n;
	for(int i=1;i<=n;i++)scanf("%lld",&b[i]);
	for(int i=1;i<n;i++)c[i]=2*(b[i]-b[i+1]);
	for(int i=1;i<n;i+=2)sum+=c[i];
	sum+=2*b[n];
	a[1]=sum/2;
	for(int i=2;i<=n;i++)a[i]=2*b[i-1]-a[i-1];
	for(int i=1;i<=n;i++)printf("%lld ",a[i]);
}