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