#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  unsigned long long ans[n], x, mini = 0, maxi = ULLONG_MAX;
  unsigned long long leftPart, rightPart;
  for (int i = 0; i < (n / 2); i++) {
    cin >> x;
    leftPart = mini;
    rightPart = x - mini;
    if (rightPart > maxi) {
      leftPart = min(maxi, x - maxi);
      rightPart = max(maxi, x - maxi);
    }
    ans[i] = leftPart;
    ans[(n - 1) - i] = rightPart;
    mini = max(mini, leftPart);
    maxi = min(maxi, rightPart);
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i];
    if (i != n - 1) printf(" ");
  }
  return 0;
}
