#include<bits/stdc++.h>
using namespace std;
int n;
long long s,g,a[100005],x[100005];
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;++i){
		scanf("%lld",&a[i]);
		s+=a[i];
		a[i]<<=1;
	}
	for(int i=1;i<n;i+=2){
		g+=a[i];
	}
	x[n]=s-g;
	for(int i=n-1;i;i--){
		x[i]=a[i]-x[i+1];
	}
	for(int i=1;i<=n;++i)printf("%lld ",x[i]);
}