#include <bits/stdc++.h>
using namespace std;
int n;
long long a[200000], b[200000];
int main() {
  scanf("%d", &n);
  n /= 2;
  for (int i = (1); i <= (n); ++i) scanf("%lld", &b[i]);
  a[n] = b[n] / 2;
  for (int i = (n - 1); i >= (1); --i)
    a[i] = min(a[i + 1], b[i] - b[i + 1] + a[i + 1]);
  for (int i = (1); i <= (n); ++i) printf("%lld ", a[i]);
  for (int i = (n); i >= (1); --i) printf("%lld ", b[i] - a[i]);
}
