#include <bits/stdc++.h>
using namespace std;
bool Finish_read;
template <class T>
inline void read(T &x) {
  Finish_read = 0;
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    if (ch == EOF) return;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x *= f;
  Finish_read = 1;
}
template <class T>
inline void print(T x) {
  if (x / 10 != 0) print(x / 10);
  putchar(x % 10 + '0');
}
template <class T>
inline void writeln(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
  putchar('\n');
}
template <class T>
inline void write(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) {
  long long gg = gcd(a, b);
  a /= gg;
  if (a <= LLONG_MAX / b) return a * b;
  return LLONG_MAX;
}
const int N = 1000020;
long long n;
long long b[N], a[N << 1];
int main() {
  cin >> n;
  a[0] = 0;
  a[n + 1] = 0x3f3f3f3f3f3f3f3f;
  for (long long i = 1; i <= n / 2; i++) {
    read(b[i]);
    a[i] = a[i - 1];
    a[n - i + 1] = b[i] - a[i];
    if (a[n - i + 1] > a[n - i + 2] || a[n - i + 1] < a[i])
      a[n - i + 1] = a[n - i + 2], a[i] = b[i] - a[n - i + 1];
  }
  for (long long i = 1; i <= n; i++) cout << a[i] << endl;
  return 0;
}
