#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, Max = 0;
  vector<int> v;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    v.push_back(a);
  }
  Max = v.back();
  v[v.size() - 1] = 0;
  for (int i = v.size() - 2; i >= 0; i--) {
    if (v[i] < Max)
      v[i] = (Max + 1) - v[i];
    else if (v[i] == Max)
      v[i] = 1;
    else if (v[i] > Max) {
      Max = v[i];
      v[i] = 0;
    }
  }
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  return 0;
}
