#include <bits/stdc++.h>
const int MX = 10010896;
const int lmt = 3164;
const int N = 10000001;
using namespace std;
long long int extgcd(long long int a, long long int b, long long int& x,
                     long long int& y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  } else {
    int g = extgcd(b, a % b, y, x);
    y -= a / b * x;
    return g;
  }
}
long long int modpow(long long int a, long long int b) {
  long long int res = 1;
  a %= 1000000007;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
inline void solve() {
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  cout << "0 ";
  for (long long int i = 1; i < n; i++) {
    if (a[i] < a[i - 1]) {
      cout << (a[i - 1] - a[i]) << " ";
    } else
      cout << "0 ";
  }
  cout << "\n";
}
int main() {
  cout << fixed << setprecision(12);
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1, tc = 1;
  while (t--) {
    solve();
  }
  return 0;
}
