#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &a) {
  T x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = 0;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  a = f ? x : -x;
}
long long n;
long long num[500008], ans[500008];
signed main() {
  read(n);
  for (register long long i = 1; i <= (n >> 1); ++i) read(num[i]);
  for (register long long i = 1; i <= (n >> 1); ++i) {
    long long le = i, ri = n - i + 1;
    if (i == 1) {
      ans[le] = 0;
      ans[ri] = num[i];
      continue;
    } else {
      long long x = num[i], Le = ans[le - 1], Ri = ans[ri + 1];
      ans[le] = ans[ri] = Le;
      ans[ri] += x - (Le << 1);
      if (ans[ri] > ans[ri + 1])
        ans[le] += ans[ri] - ans[ri + 1], ans[ri] = ans[ri + 1];
    }
  }
  for (register long long i = 1; i <= n; ++i) cout << ans[i] << " ";
  return 0;
}
