#include <bits/stdc++.h>
using namespace std;
unsigned long long N, a[200001], x, i;
int main() {
  cin >> N;
  cin >> a[N];
  a[1] = 0;
  for (i = 2; i <= N / 2; ++i) {
    cin >> x;
    if (x <= a[N - i + 2] + a[i - 1]) {
      a[N - i + 1] = x - a[i - 1];
      ;
      a[i] = a[i - 1];
    } else {
      a[i] = x - a[N - i + 2];
      a[N - i + 1] = x - a[i];
    }
  }
  for (i = 1; i <= N; ++i) cout << a[i] << ' ';
  return 0;
}
