#include <bits/stdc++.h>
using namespace std;
long long modulo(long long a, long long b, long long n);
long long choose(long long n, long long k);
long long inverse(long long a, long long m);
bool isPrime(long long n);
void sieve(bool isPrime[], long long n);
void factorizefunction(long long minPrime[], long long n);
vector<long long> factorize(long long n);
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(0);
  srand(time(NULL));
  cout << fixed;
  cout << setprecision(15);
  ;
  long long n;
  cin >> n;
  long long a[n];
  long long l = 0, r = LONG_LONG_MAX;
  for (long long i = 0; i < n / 2; i++) {
    long long t;
    cin >> t;
    a[i] = max(l, t - r);
    a[n - i - 1] = t - a[i];
    l = a[i];
    r = a[n - i - 1];
  }
  for (long long i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
long long modulo(long long a, long long b, long long n) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y) % n;
    }
    y = (y * y) % n;
    b /= 2;
  }
  return x % n;
}
long long choose(long long n, long long k) {
  if (k == 0) return 1;
  return (n * choose(n - 1, k - 1)) / k;
}
void EE(long long a, long long b, long long &co1, long long &co2) {
  if (a % b == 0) {
    co1 = 0;
    co2 = 1;
    return;
  }
  EE(b, a % b, co1, co2);
  long long temp = co1;
  co1 = co2;
  co2 = temp - co2 * (a / b);
}
long long inverse(long long a, long long m) {
  long long x, y;
  EE(a, m, x, y);
  if (x < 0) x += m;
  return x;
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6) {
    if (n % i == 0 || n % (i + 2) == 0) return false;
  }
  return true;
}
void sieve(bool isPrime[], long long n) {
  for (long long i = 1; i <= n; i++) isPrime[i] = true;
  isPrime[0] = false;
  isPrime[1] = false;
  for (long long i = 2; i * i <= n; i++) {
    if (isPrime[i] == true) {
      for (long long j = (i * i); j <= n; j += i) isPrime[j] = false;
    }
  }
}
void factorizefunction(long long minPrime[], long long n) {
  for (long long i = 2; i * i <= n; ++i) {
    if (minPrime[i] == 0) {
      for (long long j = i * i; j <= n; j += i) {
        if (minPrime[j] == 0) {
          minPrime[j] = i;
        }
      }
    }
  }
  for (long long i = 2; i <= n; ++i) {
    if (minPrime[i] == 0) {
      minPrime[i] = i;
    }
  }
}
vector<long long> factorize(long long n) {
  long long minPrime[0];
  vector<long long> res;
  while (n != 1) {
    res.push_back(minPrime[n]);
    n /= minPrime[n];
  }
  return res;
}
