#include <bits/stdc++.h>
using namespace std;
long long XX[8] = {+1, +1, +1, 0, 0, -1, -1, -1};
long long YY[8] = {+1, 0, -1, +1, -1, +1, 0, -1};
long long dx[4] = {-1, 1, 0, 0};
long long dy[4] = {0, 0, 1, -1};
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  cout << 0 << " ";
  for (long long i = 1; i < n; i++) {
    if (a[i] < a[i - 1]) {
      long long d = a[i - 1] - a[i];
      a[i] = a[i] + d;
      cout << d << " ";
    } else {
      cout << 0 << " ";
    }
  }
  return 0;
}
