import std.algorithm;
import std.array;
import std.stdio;
import std.conv;
import std.string;

void main(){
    "passed".writeln
    int[] array = readln.split.map!(to!int).array;
    array.map!(to!string).join(" ").writeln;
    foreach(i; 2..array.length){
        int key = array[i];
        size_t j = i - 1;
        while(j > 0 && array[j] > key){
            array[j + 1] = array[j];
            --j;
        }
        array[j+1] = key;
        array.map!(to!string).join(" ").writeln;
    }
}