#include <bits/stdc++.h>
using namespace std;
long long a[100001], arr[200001];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n / 2; i++) cin >> a[i];
  arr[1] = 0, arr[n] = a[1];
  for (int i = 2; i <= n / 2; i++) {
    arr[i] = max(arr[i - 1], a[i] - arr[n - i + 2]);
    arr[n - i + 1] = a[i] - arr[i];
  }
  for (int i = 1; i <= n; i++) cout << arr[i] << ' ';
}
