#include <bits/stdc++.h>
using namespace std;
const int Max = 10e9 + 7;
long long a[200005], b[100005];
int t, n, m;
string s;
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n / 2; i++) cin >> b[i];
  a[1] = 0;
  a[n] = b[1];
  for (int i = 2; i <= n / 2; i++) {
    if (b[i] - a[i - 1] <= a[n - i + 2]) {
      a[i] = a[i - 1];
      a[n - i + 1] = b[i] - a[i];
    } else {
      a[n - i + 1] = min(b[i], a[n - i + 2]);
      a[i] = b[i] - a[n - i + 1];
    }
  }
  for (int i = 1; i < n; i++) cout << a[i] << ' ';
  cout << a[n] << '\n';
  return 0;
}
