#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    int a[n];
    int cnt = 0;
    for(int i=0;i<n;i++){
        cin >> a[i];
        cnt += a[i];
    } 
    cnt /= 2;
    for(int i=1;i<n;i+=2) cnt -=a[i];
    for(int i=0;i<n;i++){
        cout << 2 * cnt << " ";
        cnt = a[i] - cnt;
    }
    cout << endl;
}