#include <bits/stdc++.h>
using namespace std;
long long n, b[100005], a[200005];
void solve() {
  cin >> n;
  for (long long i = 1; i < n / 2 + 1; i++) cin >> b[i];
  a[1] = 0;
  a[n] = b[1];
  for (long long i = 2; i < n / 2 + 1; i++) {
    a[i] = max(a[i - 1], b[i] - a[n - i + 2]);
    a[n - i + 1] = b[i] - a[i];
  }
  for (long long i = 1; i < n + 1; i++) cout << a[i] << " ";
  cout << '\n';
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
