#include <bits/stdc++.h>
#pragma disable : 4996)
using namespace std;
const long long inf = 0x7f7f7f7f;
long long GCD(long long a, long long b) { return 0 == b ? a : GCD(b, a % b); }
const long long mod = 1e9 + 7;
const double pi = acos(-1);
long long b[210000];
long long a[210000];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n / 2; i++) cin >> b[i];
  long long ans1 = 0, ans2 = 0;
  int k = 0;
  a[k++] = 0;
  ans2 = b[0] - 0;
  for (int i = 1; i < n / 2; i++) {
    if (b[i] - ans1 <= ans2 && ans1 >= a[k - 1])
      a[k++] = ans1, ans2 = b[i] - ans1;
    else
      ans1 = a[k++] = b[i] - ans2;
  }
  for (int i = n / 2 - 1; i >= 0; i--) a[k++] = b[i] - a[i];
  for (int i = 0; i < k; i++) cout << a[i] << " ";
}
