#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, m, x, y, i, j, ans = 0, c = 0, sum = 0;
  cin >> n;
  long long int b[n / 2 + 1];
  for (i = 1; i <= n / 2; i++) cin >> b[i];
  std::vector<long long int> v(n + 1);
  v[1] = 0;
  v[n] = b[1];
  for (i = 2; i <= n / 2; i++) {
    if (b[i] >= b[i - 1]) {
      v[n - i + 1] = v[n - i + 2];
      v[i] = b[i] - v[n - i + 2];
    } else {
      v[i] = v[i - 1];
      v[n - i + 1] = b[i] - v[i - 1];
    }
  }
  for (i = 1; i <= n; i++) cout << v[i] << " ";
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
