#include <bits/stdc++.h>
using namespace std;
char f, g;
string s, p;
double aa, bb, cc;
long long int arr[200005], brr[200005];
vector<int> v, va, vb;
map<int, int> mp;
int main() {
  long long int a, b, c, n, m, t, i, j, k, x, y, z;
  cin >> n;
  for (i = 1; i <= n / 2; i++) {
    cin >> brr[i];
  }
  int index;
  for (i = 1; i <= n / 2; i++) {
    index = n - i;
    index++;
    if (i == 1) {
      arr[i] = 0;
      arr[n] = brr[i];
    } else {
      x = brr[i];
      y = arr[index + 1];
      a = x - y;
      if (a < arr[i - 1]) {
        arr[i] = arr[i - 1];
        arr[index] = x - arr[i - 1];
      } else {
        arr[i] = min(a, y);
        arr[index] = max(a, y);
      }
    }
  }
  for (i = 1; i <= n; i++) {
    cout << arr[i] << ' ';
  }
  return 0;
}
