#include <bits/stdc++.h>
using namespace std;
int main(){
int N; cin >> N;
int A[N];
unsigned long long all=0;
for(int i=1; i<N; i++){ cin >> A[i]; all+=A[i]; } 
cin >> A[0]; all=(all+A[0])/2;
int ans[N];
for(int i=1; i<=N-2; i+=2){ all-=A[i]; }
ans[0]=all;
for(int i=1; i<N; i++){ ans[i]=A[i-1]-ans[i-1]; cout << 2*ans[i] << " "; }
cout << 2*ans[0] << "\n";
}