#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long Res = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') f = (ch == '-' ? -f : f), ch = getchar();
  while (ch >= '0' && ch <= '9') Res = Res * 10 + ch - '0', ch = getchar();
  return Res * f;
}
int N;
long long B[200005], A[200005];
int main() {
  N = read();
  for (int i = 1; i <= N / 2; i++) B[i] = read();
  A[1] = 0;
  A[N] = B[1];
  for (int i = 2; i <= N / 2; i++) {
    if (B[i] - A[i - 1] <= A[N - i + 2])
      A[i] = A[i - 1], A[N - i + 1] = B[i] - A[i];
    else
      A[N - i + 1] = A[N - i + 2], A[i] = B[i] - A[N - i + 2];
  }
  for (int i = 1; i <= N; i++) printf("%lld ", A[i]);
  puts("");
  return 0;
}
