#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int INF = 1000000001;
long long n, a[200005], b[200005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  for (int i = 1; i <= n / 2; i++) cin >> b[i];
  a[n] = b[1];
  for (int i = 2; i <= n / 2; i++) {
    a[i] = max(a[i - 1], b[i] - a[n - i + 2]);
    a[n - i + 1] = b[i] - a[i];
  }
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  cout << "\n"
       << "\n";
  return 0;
}
