#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<long long> a(n + 1);
  for (int i = 0; i < n / 2; i++) {
    long long b;
    cin >> b;
    if (i == 0) {
      a[0] = 0;
      a[n - 1] = b;
    } else {
      a[i] = max(a[i - 1], min(a[n - i], b - a[n - i]));
      a[n - 1 - i] = b - a[i];
    }
  }
  for (int i = 0; i < n; i++) cout << a[i] << ' ';
  return 0;
}
