#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> b(n / 2);
  vector<long long> a(n);
  for (long i = 0; i < n / 2; i++) {
    cin >> b[i];
  }
  a[(n / 2) - 1] = b[(n / 2) - 1] / 2;
  if (b[(n / 2) - 1] % 2 == 0) {
    a[n / 2] = b[(n / 2) - 1] / 2;
  } else {
    a[n / 2] = (b[(n / 2) - 1] / 2) + 1;
  }
  for (long i = 1; i < n / 2; i++) {
    long long j = 0;
    j = a[(n / 2) + i - 1] + a[n / 2 - i] - b[n / 2 - i - 1];
    if (j < 0) {
      j = 0;
    }
    a[n / 2 - i - 1] = a[(n / 2) - i] - j;
    a[n / 2 + i] = b[n / 2 - i - 1] - a[(n / 2) - i] + j;
  }
  for (long i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
