#include <bits/stdc++.h>
using namespace std;
int main(){
	int n; cin >> n;
	vector<long long> a(n);
	for(int i = 0; i < n; i++) cin >> a[i];
	long long val = 0;
	for(int i = 0; i < n; i++){
		if(i&1) val -= a[i];
		else val += a[i];
	}
	cout << val;
	for(int i = 0; i < n - 1; i++){
		val = 2 * a[i] - val;;
		cout << " " << val;
	}
	cout << endl;
	return 0;
}
