#include <bits/stdc++.h>
using namespace std;
long long n, a[200005];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n / 2; i++) cin >> a[n - 1 - i];
  for (long long i = 1; i < n / 2; i++) {
    long long x = max(a[i - 1], a[n - 1 - i] - a[n - i]);
    a[i] = x;
    a[n - 1 - i] -= x;
  }
  for (long long i = 0; i < n; i++) cout << a[i] << ' ';
}
