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