#include <iostream>
#include <cstdio>
#define N 100005
using namespace std;

typedef long long ll;
ll n, s, a[N];
int main()
{
	int i;
	cin >> n;
	for (i = 0; i < n; i++) {
		scanf("%lld", &a[i]);
		a[i] *= 2;
		s += a[i] * (1 - i % 2 * 2);
	}
	s /= 2;
	cout << s << ' ';
	for (i = 0; i < n - 1; i++) s = a[i] - s, printf("%lld ", s);
    return 0;
}