#include <bits/stdc++.h>
using namespace std;
long long A[100005] = {0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  long long ary[200001], ary1[200001];
  cin >> n;
  for (long long i = 1; i <= n / 2; i++) {
    cin >> ary[i];
  }
  ary1[1] = 0;
  ary1[n] = ary[1];
  for (long long i = 2; i < (n / 2 + 1); i++) {
    if (ary[i] > ary1[n - i + 2])
      ary1[n - i + 1] = ary1[n - i + 2];
    else
      ary1[n - i + 1] = ary[i];
    ary1[i] = ary[i] - ary1[n - i + 1];
    if (ary1[i] < ary1[i - 1]) {
      ary1[i] = ary1[i - 1];
      ary1[n - i + 1] = ary[i] - ary1[i];
    }
  }
  for (long long i = 1; i <= n; i++) {
    cout << ary1[i] << " ";
  }
  return 0;
}
