#include <bits/stdc++.h>
using namespace std;
using namespace std;
int n;
long long a[1000006];
long long b[1000006];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  n /= 2;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long last1 = 0, last2 = 1e18;
  for (int i = 0; i < n; i++) {
    long long fir = last1;
    long long sec = min(last2, a[i] - fir);
    fir = a[i] - sec;
    b[i] = fir;
    b[2 * n - i - 1] = sec;
    last1 = fir, last2 = sec;
  }
  for (int i = 0; i < 2 * n; i++) cout << b[i] << " ";
  cout << endl;
  return 0;
}
