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