#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  long long a[n + 1];
  long long b[n + 1];
  for (int i = 1; i <= n / 2; i++) {
    cin >> b[i];
  }
  a[1] = 0;
  a[n] = b[1];
  long long temp = b[1], temp2 = 0;
  for (int i = 2; i <= n / 2; i++) {
    long long x = b[i];
    x -= temp2;
    if (x >= temp) {
      temp2 += (x - temp);
      a[i] = temp2;
      a[n - i + 1] = temp;
    } else {
      a[i] = temp2;
      temp = x;
      a[n - i + 1] = x;
    }
  }
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  return 0;
}
