#include <bits/stdc++.h>
using namespace std;
int oo = (1e9) + 7;
int main() {
  long long n;
  cin >> n;
  vector<long long> b(n / 2 + 5, 0);
  for (int i = 1; i <= n / 2; i++) {
    scanf("%lld", &b[i]);
  }
  vector<long long> out(n + 5, 0);
  long long l = 0;
  long long r = 0;
  for (int i = 1; i <= n / 2; i++) {
    out[i] = 0;
    out[n - i + 1] = b[i];
    if (i > 1) {
      if (b[i] > r) {
        out[i] = b[i] - r;
        out[n - i + 1] = r;
      }
      long long tmp = b[i];
      if (out[i] < l) {
        out[i] = l;
        out[n - i + 1] = b[i] - l;
      }
    }
    l = out[i];
    r = out[n - i + 1];
  }
  for (int i = 1; i <= n; i++) {
    printf("%lld ", out[i]);
  }
  return 0;
}
