#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int a[n], b[n / 2];
  long long int i, j = INT_MIN, k = INT_MAX, l;
  for (i = 0; i < (n / 2); i++) {
    cin >> b[i];
  }
  a[0] = 0;
  a[n - 1] = b[0];
  for (i = 1; i < (n / 2); i++) {
    a[n - i - 1] = a[n - i];
    a[i] = (b[i] - a[n - i - 1]);
    long long int f = max(a[i], a[i - 1]);
    a[i] = f;
    a[n - i - 1] = (b[i] - a[i]);
  }
  for (i = 0; i < n; i++) cout << a[i] << " ";
}
