#include <bits/stdc++.h>   using namespace std;   long long n, x, a[200005], b[200005];   int main() {     cin >> n;     for (int i = 1; i <= n / 2; i++) cin >> b[i];     a[1] = 0;     a[n] = b[1];     for (int i = 2; i <= n / 2; i++) {       a[i] = a[i - 1];       a[n - i + 1] = b[i] - a[i];       if (a[n - i + 1] > a[n - i + 2]) {         a[n - i + 1] = a[n - i + 2];         a[i] = b[i] - a[n - i + 1];       }     }     for (int i = 1; i <= n; i++) {       cout << a[i] <<    ;     }     return 0;   }   