#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int m, n, j, x, z;
  cin >> n;
  m = n / 2;
  long long int b[m], a[n];
  for (int i = 0; i < m; ++i) cin >> b[i];
  j = n - 1;
  a[0] = 0;
  a[j] = b[0];
  x = 0;
  z = b[0];
  for (int i = 1; i < m; ++i) {
    if (b[i] > b[i - 1]) {
      a[j - i] = z;
      x = b[i] - z;
      a[i] = x;
    } else if (b[i] < b[i - 1]) {
      a[i] = x;
      z = b[i] - x;
      a[j - i] = z;
    } else if (b[i] == b[i - 1]) {
      a[i] = x;
      a[j - i] = z;
    }
  }
  for (int i = 0; i < n; ++i) cout << a[i] << " ";
  return 0;
}
