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