#include <bits/stdc++.h>
using namespace std;
vector<long long> A, B;
int main() {
  ios::sync_with_stdio(false);
  long long n, tmp;
  cin >> n;
  A.assign(n, 0);
  for (int i = 0; i < n / 2; i++) {
    cin >> tmp;
    B.push_back(tmp);
  }
  long long front, back, diff;
  A[0] = 0;
  A[n - 1] = B[0];
  for (int i = 1; i < n / 2; i++) {
    front = A[i - 1], back = B[i] - front;
    diff = A[n - i] - back;
    if (diff < 0) {
      back = A[n - i];
      front -= diff;
    }
    A[i] = front;
    A[n - i - 1] = back;
  }
  for (long long i : A) cout << i << " ";
  cout << endl;
  return 0;
}
