#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
using ld = long double;
using D = double;
using ii = pair<int, int>;
using vi = vector<int>;
using vii = vector<ii>;
template <typename T>
T sqr(T a) {
  return a * a;
}
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T sgn(T a) {
  return a > 0 ? 1 : (a < 0 ? -1 : 0);
}
template <typename T>
T abs(T a) {
  return a > 0 ? a : -a;
}
const int inf = 2e9;
const ld st = 0.000001;
const ld pi = acos((ld)-1);
ll a[200002];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  ll n;
  cin >> n;
  vector<ll> b;
  for (int i = 0; i < n / 2; i++) {
    ll x;
    cin >> x;
    b.push_back(x);
  }
  a[0] = 0;
  a[n - 1] = b[0];
  for (int i = 1; i < ((int)b.size()); i++) {
    a[i] = max(b[i] - a[n - i], a[i - 1]);
    a[n - i - 1] = b[i] - a[i];
  }
  for (int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
