#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int a = n / 2;
  long long int arr[a];
  long long int ans[n];
  long long int max = 0;
  for (long long int i = 0; i < a; i++) {
    cin >> arr[i];
    if (i == 0) {
      ans[0] = 0;
      ans[n - 1] = arr[0];
    } else {
      if (arr[i] - ans[i - 1] > ans[n - i]) {
        ans[n - i - 1] = ans[n - i];
        ans[i] = arr[i] - ans[n - i - 1];
      } else {
        ans[i] = ans[i - 1];
        ans[n - i - 1] = arr[i] - ans[i];
      }
    }
  }
  for (long long int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
  cout << "\n";
  return 0;
}
