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

int main() {
	int n,s=0,su=0;
	cin>>n;int a[n];
	for(int i=0;i<n;i++)
	{
	    cin>>a[i];su+=a[i];
	    if(i&1)
	    s+=a[i];
	}int f=su/2-s;
	cout<<2*f<<" ";
	for(int i=0;i<n-1;i++){
	cout<<2*(a[i]-f)<<" ";
	f=a[i]-f;}
	return 0;
}