#include <bits/stdc++.h>
using namespace std;
inline void boost() {
  ios_base::sync_with_stdio();
  cin.tie(0);
  cout.tie(0);
}
const long long maxn = 2e5 + 123;
const long long inf = 1e9 + 123;
const long long mod = 1e9 + 7;
const double pi = acos(-1);
long long a[maxn], b[maxn];
int main() {
  boost();
  long long n;
  cin >> n;
  for (int i = 1; i <= n / 2; i++) {
    cin >> b[i];
  }
  a[n / 2 + 1] = (b[n / 2] + 1) / 2;
  a[n / 2] = b[n / 2] - a[n / 2 + 1];
  for (int i = n / 2 + 1; i <= n; i++) {
    a[i] = (b[n - i + 1] + 1) / 2;
    a[n - i + 1] = b[n - i + 1] / 2;
    if (a[i] < a[i - 1]) {
      long long r = a[i - 1] - a[i];
      a[n - i + 1] -= r;
      a[i] += r;
    }
    if (a[n - i + 1] > a[n - i + 2]) {
      long long r = a[n - i + 1] - a[n - i + 2];
      a[n - i + 1] -= r;
      a[i] += r;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
