#include <bits/stdc++.h>
#pragma warning(disable : 4996)
const int N = 5e5 + 20;
const long long int M = 1e17;
using namespace std;
int a[N];
void solve(int i, int m) {
  if (i < 0) return;
  solve(i - 1, max(a[i], m));
  cout << max(0, m + 1 - a[i]) << ' ';
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  solve(n - 1, 0);
}
