#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i;
  cin >> n;
  long long a[n];
  long long tp = n / 2;
  long long b[tp];
  for (i = 0; i < tp; i++) {
    cin >> b[i];
  }
  a[n / 2 - 1] = b[n / 2 - 1] / 2;
  for (i = n / 2 - 2; i >= 0; i--) {
    a[i] = min(a[i + 1], b[i] - b[i + 1] + a[i + 1]);
  }
  for (i = 0; i < n / 2; i++) cout << a[i] << " ";
  for (i = n / 2 - 1; i >= 0; i--) cout << b[i] - a[i] << " ";
  cout << '\n';
  return 0;
}
