#include <iostream>
#include <cstdio>
using namespace std;
typedef long long ll;

ll n, s, s1, a[100005];
int main() {
	ll i, k;
	cin>>n;
	for(i=0; i<n; i++) {
		scanf("%lld", &a[i]);
		s += a[i];
		if(i%2) s1 += a[i] * 2;
	}
	k = s - s1;
	for(i=0; i<n; i++) {
		printf("%lld ", k);
		k = a[i] * 2 - k;
	}
	return 0;
}
