#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
long long a[N], ar[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n / 2; i++) scanf("%I64d", &a[i]);
  long long lw = 0, up = 1e18;
  for (int i = 1; i <= n / 2; i++)
    if (a[i] - lw <= up) {
      ar[i] = lw;
      ar[n - i + 1] = a[i] - lw;
      up = ar[n - i + 1];
    } else {
      ar[n - i + 1] = up;
      ar[i] = a[i] - up;
      lw = a[i] - up;
    }
  for (int i = 1; i <= n; i++) printf("%I64d ", ar[i]);
  return 0;
}
