import java.util.Scanner;

 class Main{

public static void f(int A[],int N){
int i;
for(i=0;i<N;i++){
	if(i>0)
		System.out.print(" ");
  System.out.print(A[i]);
}
 System.out.println();
}
 
 
   
public static void insertionSort(int A[],int N){
    int i,j,v;
    for(i=1;i<N;i++){
        v=A[i];
        j=i-1;
   while(j>=0 && A[j]>v){
       A[j+1]=A[j];
       j--;
}
   A[j+1]=v;
  f(A,N);
}
}
   


public static void main(String[] args){
         
		 Scanner sc= new Scanner(System.in);
	         int N=sc.nextInt();
             int A[]=new int[100];
             
             int i;
             for(i=0;i<N;i++){
            	 A[i] = sc.nextInt();
             }
	        
	   f(A,N);
       
        insertionSort(A,N);
        sc.close();
}
} import java.util.Scanner; Scanner java.util class Main{

public static void f(int A[],int N){
int i;
for(i=0;i<N;i++){
	if(i>0)
		System.out.print(" ");
  System.out.print(A[i]);
}
 System.out.println();
}
 
 
   
public static void insertionSort(int A[],int N){
    int i,j,v;
    for(i=1;i<N;i++){
        v=A[i];
        j=i-1;
   while(j>=0 && A[j]>v){
       A[j+1]=A[j];
       j--;
}
   A[j+1]=v;
  f(A,N);
}
}
   


public static void main(String[] args){
         
		 Scanner sc= new Scanner(System.in);
	         int N=sc.nextInt();
             int A[]=new int[100];
             
             int i;
             for(i=0;i<N;i++){
            	 A[i] = sc.nextInt();
             }
	        
	   f(A,N);
       
        insertionSort(A,N);
        sc.close();
}
} Main public static void f(int A[],int N){
int i;
for(i=0;i<N;i++){
	if(i>0)
		System.out.print(" ");
  System.out.print(A[i]);
}
 System.out.println();
} f {
int i;
for(i=0;i<N;i++){
	if(i>0)
		System.out.print(" ");
  System.out.print(A[i]);
}
 System.out.println();
} int i; i for(i=0;i<N;i++){
	if(i>0)
		System.out.print(" ");
  System.out.print(A[i]);
} i=0; i=0 i 0 i<N i N i++ i++ i {
	if(i>0)
		System.out.print(" ");
  System.out.print(A[i]);
} {
	if(i>0)
		System.out.print(" ");
  System.out.print(A[i]);
} if(i>0)
		System.out.print(" "); i>0 i 0 System.out.print(" ") System.out.print System.out System System.out " " System.out.print(A[i]) System.out.print System.out System System.out A[i] A i System.out.println() System.out.println System.out System System.out int A[] A int N N public static void insertionSort(int A[],int N){
    int i,j,v;
    for(i=1;i<N;i++){
        v=A[i];
        j=i-1;
   while(j>=0 && A[j]>v){
       A[j+1]=A[j];
       j--;
}
   A[j+1]=v;
  f(A,N);
}
} insertionSort {
    int i,j,v;
    for(i=1;i<N;i++){
        v=A[i];
        j=i-1;
   while(j>=0 && A[j]>v){
       A[j+1]=A[j];
       j--;
}
   A[j+1]=v;
  f(A,N);
}
} int i i j j v; v for(i=1;i<N;i++){
        v=A[i];
        j=i-1;
   while(j>=0 && A[j]>v){
       A[j+1]=A[j];
       j--;
}
   A[j+1]=v;
  f(A,N);
} i=1; i=1 i 1 i<N i N i++ i++ i {
        v=A[i];
        j=i-1;
   while(j>=0 && A[j]>v){
       A[j+1]=A[j];
       j--;
}
   A[j+1]=v;
  f(A,N);
} {
        v=A[i];
        j=i-1;
   while(j>=0 && A[j]>v){
       A[j+1]=A[j];
       j--;
}
   A[j+1]=v;
  f(A,N);
} v=A[i] v A[i] A i j=i-1 j i-1 i 1 while(j>=0 && A[j]>v){
       A[j+1]=A[j];
       j--;
} j>=0 && A[j]>v j>=0 j 0 A[j]>v A[j] A j v {
       A[j+1]=A[j];
       j--;
} A[j+1]=A[j] A[j+1] A j+1 j 1 A[j] A j j-- j A[j+1]=v A[j+1] A j+1 j 1 v f(A,N) f A N int A[] A int N N public static void main(String[] args){
         
		 Scanner sc= new Scanner(System.in);
	         int N=sc.nextInt();
             int A[]=new int[100];
             
             int i;
             for(i=0;i<N;i++){
            	 A[i] = sc.nextInt();
             }
	        
	   f(A,N);
       
        insertionSort(A,N);
        sc.close();
} main {
         
		 Scanner sc= new Scanner(System.in);
	         int N=sc.nextInt();
             int A[]=new int[100];
             
             int i;
             for(i=0;i<N;i++){
            	 A[i] = sc.nextInt();
             }
	        
	   f(A,N);
       
        insertionSort(A,N);
        sc.close();
} Scanner sc= new Scanner(System.in); sc new Scanner(System.in) int N=sc.nextInt(); N sc.nextInt() sc.nextInt sc int A[]=new int[100]; A new int[100] 100 int i; i for(i=0;i<N;i++){
            	 A[i] = sc.nextInt();
             } i=0; i=0 i 0 i<N i N i++ i++ i {
            	 A[i] = sc.nextInt();
             } {
            	 A[i] = sc.nextInt();
             } A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc f(A,N) f A N insertionSort(A,N) insertionSort A N sc.close() sc.close sc String[] args args
import java.util.Scanner;

 class Main{

public static void f(int A[],int N){
int i;
for(i=0;i<N;i++){
	if(i>0)
		System.out.print(" ");
  System.out.print(A[i]);
}
 System.out.println();
}
 
 
   
public static void insertionSort(int A[],int N){
    int i,j,v;
    for(i=1;i<N;i++){
        v=A[i];
        j=i-1;
   while(j>=0 && A[j]>v){
       A[j+1]=A[j];
       j--;
}
   A[j+1]=v;
  f(A,N);
}
}
   


public static void main(String[] args){
         
		 Scanner sc= new Scanner(System.in);
	         int N=sc.nextInt();
             int A[]=new int[100];
             
             int i;
             for(i=0;i<N;i++){
            	 A[i] = sc.nextInt();
             }
	        
	   f(A,N);
       
        insertionSort(A,N);
        sc.close();
}
}