#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
long long b[maxn];
long long a[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n / 2; i++) {
    scanf("%lld", &b[i]);
  }
  a[1] = 0, a[n] = b[1];
  for (int i = 2; i <= n / 2; i++) {
    a[n - i + 1] = a[n - i + 2];
    a[i] = b[i] - a[n - i + 1];
    if (a[i] < a[i - 1]) {
      a[i] = a[i - 1];
      a[n - i + 1] = b[i] - a[i];
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%lld%c", a[i], i == n ? '\n' : ' ');
  }
}
