#include <bits/stdc++.h>
using namespace std;
long double const PI = acosl(-1);
const long long INF = 1E18 + 123;
const int MAXN = 4e5 + 123;
const long long MOD = 998244353;
const long double EPS = 0;
long long a[MAXN];
long long cnt[MAXN];
void solve() {
  int n;
  cin >> n;
  for (int i = 0; i < n / 2; i++) {
    cin >> a[i];
  }
  long long k = 0ll;
  cnt[n] = INF;
  for (int i = 0; i < n / 2; i++) {
    if (cnt[n - i] < a[i] - k) k = a[i] - cnt[n - i];
    cnt[i] = k;
    cnt[n - i - 1] = a[i] - k;
  }
  for (int i = 0; i < n; i++) cout << cnt[i] << ' ';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) solve();
  return 0;
}
