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