#include <bits/stdc++.h>
using namespace std;
int read(int &val) { return scanf("%d", &val); }
void print(int val) { printf("%d\n", val); }
int div2(int val) { return (val >> 1); }
const int N = 1e5 * 2;
long long a[N], b[N];
int main() {
  int n;
  read(n);
  for (int i = 1; i <= div2(n); i++) {
    long long x;
    scanf("%I64d", &x);
    if (i == 1)
      a[n] = x;
    else {
      a[n - i + 1] = a[n - i + 2];
      a[i] = x - a[n - i + 1];
      if (a[i] < a[i - 1]) {
        long long k = a[i - 1] - a[i];
        a[i] += k;
        a[n - i + 1] -= k;
      }
    }
  }
  for_each(a + 1, a + n + 1, [](long long x) { printf("%I64d ", x); });
  return 0;
}
