#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000010;
long long b[maxn], ans[maxn];
int main() {
  int N;
  scanf("%d", &N);
  for (int i = 1; i <= N / 2; i++) scanf("%lld", &b[i]);
  ans[1] = 0;
  ans[N] = b[1];
  for (int i = 2; i <= N / 2; i++) {
    long long tmp = b[i] - ans[i - 1];
    if (tmp > ans[N + 1 - (i - 1)]) {
      ans[N + 1 - i] = ans[N + 1 - (i - 1)];
      ans[i] = b[i] - ans[N + 1 - i];
    } else
      ans[i] = ans[i - 1], ans[N + 1 - i] = b[i] - ans[i];
  }
  for (int i = 1; i <= N; i++) printf("%lld ", ans[i]);
  return 0;
}
