'use strict';
var y;
var d = [];
var c = 0;
var count = [];
var reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
reader.on('line', (line) => {
    lines.push(line);
});
reader.on('close', () => {
    n = parseInt(lines[0]);
    x = lines[1].split(' ');
    for (var i = 0; i < n; i++) {
        d = x.slice(0, x.length - i + 1);
        y = Math.max(d);
        while (parseInt(d[d.length - i]) < y) {
            d[d.length - i] = parseInt(d[d.length - i]) + 1;
            c++;
        }
        count.unshift(c);
        c = 0;
       
        }
console.log(count.join(' '));
});