// abc133d: Rain Flows into Dams
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;

#define upto(i,s,e,d) for(int i=(s);i<(e);i+=(d))

int main(){
  int n; cin>>n;
  int m0 = 0;
  vi d(n);
  upto(i,0,n,1){
    cin>>d[i];
    if(i%2) m0 -= d[i]; else m0 += d[i];
  }
  cout<<m0;
  upto(i,0,n-1,1) cout<<" "<<(m0 = d[i]*2 - m0);
  cout<<endl;
}