const input = require('fs').readFileSync('/dev/stdin', 'utf8');
const lines = input.split("\n");

const m = Number(lines[0])
const n = lines[1].split(" ").map(Number)

for (var i=0;i<m;i++){
    for(var t =0;i-t>0;t++){
        if(n[i-t]<n[i-t-1]){
            const l = n[i-t];
            const k = n[i-t-1];
            n[i-t] = k
            n[i-t-1] = l
        }else{
            break;
        }
    }
    console.log(n.join(' '))
}
