#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<long long> b(n / 2);
  for (auto& e : b) cin >> e;
  vector<long long> a(n);
  for (int i = 0; i < n / 2; ++i) {
    if (i > 0) {
      a[i] = max(a[i - 1], a[i - 1] - b[i - 1] + b[i]);
    }
    a[n - i - 1] = b[i] - a[i];
  }
  for (auto& e : a) cout << e << ' ';
  cout << '\n';
}
