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