#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    int arr[n];
    for( int i = 0 ; i < n ; i++ ) cin >> arr[i];
    int maxx=0;
    int stool[n]={0};
    for( int i = 0 ; i < n ; i++ )
    {
        if( arr[i] >= maxx )
        {
            stool[i] = 0;
            maxx = arr[i];
        }
        else
        {
            stool[i] = maxx-arr[i];
        }
        cout << stool[i] << " ";
    }
}