#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, x;
  cin >> n;
  n = n / 2;
  vector<long long int> a(2 * n + 2, 0);
  a.back() = numeric_limits<long long int>::max();
  for (long long int i = 1; i <= n; i++) {
    cin >> x;
    a[2 * n + 1 - i] = min(min(x, x - a[i - 1]), a[2 * n + 2 - i]);
    a[i] = x - a[2 * n + 1 - i];
  }
  for (long long int i = 1; i <= 2 * n; i++) cout << a[i] << " ";
  return 0;
}
