#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long ll;
int main() {
  int n;
  cin >> n;
  ll a[n];
  ll sum=0,esum=0,ans;
  rep(i,n){
     cin>>a[i];
     sum+=a[i];
     if(i%2)esum+=a[i]; 
  }
  ans=sum-esum*2;
  rep(i,n){
    cout<<ans<<" ";
    ans=(a[i]-ans/2)*2;
  }
  return 0;
}
