#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<long long int> arr(n + 1);
  long long int prevs = 0;
  long long int prevl = 0;
  long long int temp, temp2;
  for (int i = 1; i <= (n / 2); i++) {
    cin >> temp;
    if (i == 1) {
      prevs = 0;
      prevl = temp;
      arr[i] = prevs;
      arr[n - i + 1] = prevl;
    } else {
      if (temp - prevs <= prevl) {
        prevl = temp - prevs;
      } else {
        prevs = temp - prevl;
      }
      arr[i] = prevs;
      arr[n - i + 1] = prevl;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << arr[i] << " ";
  }
  cout << endl;
  return 0;
}
