#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  unsigned long long x, y;
  cin >> n;
  unsigned long long* Arr =
      (unsigned long long*)malloc((n / 2) * sizeof(long long));
  unsigned long long* Res = (unsigned long long*)malloc(n * sizeof(long long));
  for (int i = 0; i < n / 2; i++) cin >> Arr[i];
  Res[0] = 0;
  Res[n - 1] = Arr[0];
  for (int i = 1; i < n / 2; i++) {
    x = Res[i - 1];
    y = Arr[i] - x;
    if (x >= Res[i - 1] && y <= Res[n - i]) {
      Res[i] = x;
      Res[n - i - 1] = y;
    } else {
      Res[n - i - 1] = Res[n - i];
      Res[i] = Arr[i] - Res[n - i];
    }
  }
  for (int i = 0; i < n; i++) cout << Res[i] << " ";
  return 0;
}
