import java.util.Scanner;
class Main{
    public static void main(String[] args){
	int key,i,j,k,l;
	int array[] = new int[101];

	Scanner scan = new Scanner(System.in);
	array[0] = scan.nextInt();
	for(l=1;l<=array[0];l++){
	    array[l] = scan.nextInt();
	}
	
	
	for(i=1;i<=array[0];i++){
	    key = array[i];
	    j = i-1;
	    while(j>0 && array[j]>key){
		array[j+1] = array[j];
		j--;
		array[j+1] = key;
	    }
	    for(k=1;k<=array[0];k++){
		if(k==array[0]){System.out.print(array[k]+"\n");
		    break;
		}
		System.out.print(array[k]+" ");
	    }
	}
    }
}


/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz