#include <bits/stdc++.h>
using namespace std;
const long long int N = 100005;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  {
    long long int i, j, k, n, m, ans = 0, cnt = 0, sum = 0;
    cin >> n;
    long long int a[n / 2];
    for (i = 0; i < n / 2; i++) {
      cin >> a[i];
    }
    long long int b[n];
    cnt = 0;
    long long int last = 1e18 + 1;
    for (i = 0; i < n / 2; i++) {
      if (a[i] - cnt <= last) {
        b[i] = cnt;
        b[n - i - 1] = a[i] - cnt;
      } else {
        cnt = a[i] - last;
        b[i] = cnt;
        b[n - i - 1] = a[i] - cnt;
      }
      last = b[n - i - 1];
    }
    for (i = 0; i < n; i++) {
      cout << b[i] << " ";
    }
  }
}
