


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
  public static void main(String args[]) throws IOException{
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


   int n = Integer.parseInt( br.readLine() );
   String[] string =  br.readLine().split(" ");
   int[] Progression = new int[n];

   for(int i = 0; i < n ; i++ ){

	   Progression[i] = Integer.parseInt( string[i] );

   }


   for(int k = 0; k < n; k++){

  	 System.out.print(Progression[k]);
  	 if(k < n-1){
           System.out.print(" ");
       }

   }
   System.out.println();


   int v;
   for(int i = 1; i < n ; i++ ){
     v =  Progression[i] ;
     int j = i - 1;



     while(j >= 0 &&  Progression[j]  > v){
    	 Progression[j + 1] = Progression[j];
         j--;
     }

     Progression[j + 1] = v;

     for(int k = 0; k < n; k++){

    	 System.out.print(Progression[k]);
    	 if(k < n-1){
             System.out.print(" ");
         }

     }


         System.out.println();


   }




 }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main{
  public static void main(String args[]) throws IOException{
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


   int n = Integer.parseInt( br.readLine() );
   String[] string =  br.readLine().split(" ");
   int[] Progression = new int[n];

   for(int i = 0; i < n ; i++ ){

	   Progression[i] = Integer.parseInt( string[i] );

   }


   for(int k = 0; k < n; k++){

  	 System.out.print(Progression[k]);
  	 if(k < n-1){
           System.out.print(" ");
       }

   }
   System.out.println();


   int v;
   for(int i = 1; i < n ; i++ ){
     v =  Progression[i] ;
     int j = i - 1;



     while(j >= 0 &&  Progression[j]  > v){
    	 Progression[j + 1] = Progression[j];
         j--;
     }

     Progression[j + 1] = v;

     for(int k = 0; k < n; k++){

    	 System.out.print(Progression[k]);
    	 if(k < n-1){
             System.out.print(" ");
         }

     }


         System.out.println();


   }




 }
} Main public static void main(String args[]) throws IOException{
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


   int n = Integer.parseInt( br.readLine() );
   String[] string =  br.readLine().split(" ");
   int[] Progression = new int[n];

   for(int i = 0; i < n ; i++ ){

	   Progression[i] = Integer.parseInt( string[i] );

   }


   for(int k = 0; k < n; k++){

  	 System.out.print(Progression[k]);
  	 if(k < n-1){
           System.out.print(" ");
       }

   }
   System.out.println();


   int v;
   for(int i = 1; i < n ; i++ ){
     v =  Progression[i] ;
     int j = i - 1;



     while(j >= 0 &&  Progression[j]  > v){
    	 Progression[j + 1] = Progression[j];
         j--;
     }

     Progression[j + 1] = v;

     for(int k = 0; k < n; k++){

    	 System.out.print(Progression[k]);
    	 if(k < n-1){
             System.out.print(" ");
         }

     }


         System.out.println();


   }




 } main {
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


   int n = Integer.parseInt( br.readLine() );
   String[] string =  br.readLine().split(" ");
   int[] Progression = new int[n];

   for(int i = 0; i < n ; i++ ){

	   Progression[i] = Integer.parseInt( string[i] );

   }


   for(int k = 0; k < n; k++){

  	 System.out.print(Progression[k]);
  	 if(k < n-1){
           System.out.print(" ");
       }

   }
   System.out.println();


   int v;
   for(int i = 1; i < n ; i++ ){
     v =  Progression[i] ;
     int j = i - 1;



     while(j >= 0 &&  Progression[j]  > v){
    	 Progression[j + 1] = Progression[j];
         j--;
     }

     Progression[j + 1] = v;

     for(int k = 0; k < n; k++){

    	 System.out.print(Progression[k]);
    	 if(k < n-1){
             System.out.print(" ");
         }

     }


         System.out.println();


   }




 } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt( br.readLine() ); n Integer.parseInt( br.readLine() ) Integer.parseInt Integer br.readLine() br.readLine br String[] string =  br.readLine().split(" "); string br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] Progression = new int[n]; Progression new int[n] n for(int i = 0; i < n ; i++ ){

	   Progression[i] = Integer.parseInt( string[i] );

   } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

	   Progression[i] = Integer.parseInt( string[i] );

   } {

	   Progression[i] = Integer.parseInt( string[i] );

   } Progression[i] = Integer.parseInt( string[i] ) Progression[i] Progression i Integer.parseInt( string[i] ) Integer.parseInt Integer string[i] string i for(int k = 0; k < n; k++){

  	 System.out.print(Progression[k]);
  	 if(k < n-1){
           System.out.print(" ");
       }

   } int k = 0; int k = 0; k 0 k < n k n k++ k++ k {

  	 System.out.print(Progression[k]);
  	 if(k < n-1){
           System.out.print(" ");
       }

   } {

  	 System.out.print(Progression[k]);
  	 if(k < n-1){
           System.out.print(" ");
       }

   } System.out.print(Progression[k]) System.out.print System.out System System.out Progression[k] Progression k if(k < n-1){
           System.out.print(" ");
       } k < n-1 k n-1 n 1 {
           System.out.print(" ");
       } System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out int v; v for(int i = 1; i < n ; i++ ){
     v =  Progression[i] ;
     int j = i - 1;



     while(j >= 0 &&  Progression[j]  > v){
    	 Progression[j + 1] = Progression[j];
         j--;
     }

     Progression[j + 1] = v;

     for(int k = 0; k < n; k++){

    	 System.out.print(Progression[k]);
    	 if(k < n-1){
             System.out.print(" ");
         }

     }


         System.out.println();


   } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
     v =  Progression[i] ;
     int j = i - 1;



     while(j >= 0 &&  Progression[j]  > v){
    	 Progression[j + 1] = Progression[j];
         j--;
     }

     Progression[j + 1] = v;

     for(int k = 0; k < n; k++){

    	 System.out.print(Progression[k]);
    	 if(k < n-1){
             System.out.print(" ");
         }

     }


         System.out.println();


   } {
     v =  Progression[i] ;
     int j = i - 1;



     while(j >= 0 &&  Progression[j]  > v){
    	 Progression[j + 1] = Progression[j];
         j--;
     }

     Progression[j + 1] = v;

     for(int k = 0; k < n; k++){

    	 System.out.print(Progression[k]);
    	 if(k < n-1){
             System.out.print(" ");
         }

     }


         System.out.println();


   } v =  Progression[i] v Progression[i] Progression i int j = i - 1; j i - 1 i 1 while(j >= 0 &&  Progression[j]  > v){
    	 Progression[j + 1] = Progression[j];
         j--;
     } j >= 0 &&  Progression[j]  > v j >= 0 j 0 Progression[j]  > v Progression[j] Progression j v {
    	 Progression[j + 1] = Progression[j];
         j--;
     } Progression[j + 1] = Progression[j] Progression[j + 1] Progression j + 1 j 1 Progression[j] Progression j j-- j Progression[j + 1] = v Progression[j + 1] Progression j + 1 j 1 v for(int k = 0; k < n; k++){

    	 System.out.print(Progression[k]);
    	 if(k < n-1){
             System.out.print(" ");
         }

     } int k = 0; int k = 0; k 0 k < n k n k++ k++ k {

    	 System.out.print(Progression[k]);
    	 if(k < n-1){
             System.out.print(" ");
         }

     } {

    	 System.out.print(Progression[k]);
    	 if(k < n-1){
             System.out.print(" ");
         }

     } System.out.print(Progression[k]) System.out.print System.out System System.out Progression[k] Progression k if(k < n-1){
             System.out.print(" ");
         } k < n-1 k n-1 n 1 {
             System.out.print(" ");
         } System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out String args[] args



import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
  public static void main(String args[]) throws IOException{
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


   int n = Integer.parseInt( br.readLine() );
   String[] string =  br.readLine().split(" ");
   int[] Progression = new int[n];

   for(int i = 0; i < n ; i++ ){

	   Progression[i] = Integer.parseInt( string[i] );

   }


   for(int k = 0; k < n; k++){

  	 System.out.print(Progression[k]);
  	 if(k < n-1){
           System.out.print(" ");
       }

   }
   System.out.println();


   int v;
   for(int i = 1; i < n ; i++ ){
     v =  Progression[i] ;
     int j = i - 1;



     while(j >= 0 &&  Progression[j]  > v){
    	 Progression[j + 1] = Progression[j];
         j--;
     }

     Progression[j + 1] = v;

     for(int k = 0; k < n; k++){

    	 System.out.print(Progression[k]);
    	 if(k < n-1){
             System.out.print(" ");
         }

     }


         System.out.println();


   }




 }
}