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

int main(){
	int N;
	cin >> N;
	ll A[N],s(0),sum(0);
	for(int i(0);i<N;++i){
		cin >> A[i];
		A[i] *= 2;
		sum += A[i];
		if(i%2==1) s+=A[i];
	}
	int ans1 = sum/2 - s;
	cout << ans1;
	int prev(ans1);
	for(int i(0);i<N-1;++i){
		cout << ' ' << A[i] - prev;
		prev = A[i] - prev;
	}
	return 0;
}