#include <bits/stdc++.h>
long long a[200005], b[200005];
int main() {
  int n;
  long long s, e;
  scanf("%d", &n);
  for (int i = 1; i <= n / 2; i++) {
    scanf("%I64d", &a[i]);
  }
  s = 0, e = a[1];
  for (int i = 1; i <= n / 2; i++) {
    if (a[i] > e + s) {
      b[n - i + 1] = e;
      b[i] = s = a[i] - e;
    } else {
      b[n - i + 1] = e = a[i] - s;
      b[i] = s;
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%I64d ", b[i]);
  }
  return 0;
}
