#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin >> n;
    long long arr1[n];
    long long arr2[n]={0};
    for( int i = 0 ; i < n ; i++ ) 
    {
        cin >> arr1[i];
        arr2[i] = arr1[i];
        if( i > 0 )
        {
            if(arr1[i] < arr1[i-1]) arr1[i] = arr1[i-1];
        }
        //cout << arr1[i] << " ";
    }
    //cout << "\n";
    for( int i = 0 ; i < n ; i++ )
    {
        cout << arr1[i]-arr2[i] << " ";
    }
}