process.stdin.resume();
process.stdin.setEncoding('utf8');
// Here your code !
process.stdin.on("data",function(chunk){
    var line = chunk.toString().trim().split("\n");
    var num=line[0]*1;
    var li =line[1].split(" ").map(function(e){return e*1});
    function sort(l){
        for(let i=0;i<l.length;i++){
            let v = l[i];
            let j = i-1;
            while(j>=0 && l[j]>v){
                l[j+1] =l[j];
                j--;
            }
            l[j+1]=v;
            console.log(l.join(" "))
            
        }
    }
    sort(li);
})