#include <bits/stdc++.h>
const int MOD = int(1e9) + 7;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  vector<long long int> v(n);
  long long int max = 0;
  for (long long int i = 0; i < n; i++) {
    long long int a;
    cin >> a;
    if (a < max) {
      v[i] = max - a;
    } else {
      v[i] = 0;
      max = a;
    }
  }
  for (auto i = v.begin(); i != v.end(); i++) cout << *i << ' ';
  ;
}
