#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  long long int a[n], b[n / 2];
  scanf("%lld", &b[0]);
  a[0] = 0;
  a[n - 1] = b[0];
  for (int i = 1; i < n / 2; i++) {
    scanf("%lld", &b[i]);
    long long int j = max(a[i - 1], b[i] - a[n - i]);
    a[i] = j;
    a[n - i - 1] = b[i] - j;
  }
  for (int i = 0; i < n; i++) {
    printf("%lld ", a[i]);
  }
  return 0;
}
