#include <iostream>
using namespace std;
typedef long long ll;
ll n,s[100000],cnt;
int main(void){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>s[i];
        if(i%2==0)cnt+=s[i];
        else cnt-=s[i];
    }
    cout<<cnt<<" ";
    for(int i=0;i<n-1;i++){
        cnt=(s[i]-cnt/2)*2;
        cout<<cnt<<" ";
    }
    
}
