import java.util.Scanner;
public class Main{

        int n,v,j;
        int[] A;
    public void run(){
        Scanner sc =  new Scanner(System.in);
            n = sc.nextInt();
            A = new int[n];
            
            for(int i=0; i < n; i++) A[i] = sc.nextInt();
        
            trace();
        
            //insetion sort
        for (int 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;     
            trace();
        }
      
    }
        
        void trace(){         
                for (int i= 0;i<n;i++){
                    if (i > 0) System.out.print(" ");
                        System.out.print(A[i]);
                    }
                
                System.out.println();  
        }

           public static void main(String[] args){     
               new Main().run();
    } 
} import java.util.Scanner; Scanner java.util public class Main{

        int n,v,j;
        int[] A;
    public void run(){
        Scanner sc =  new Scanner(System.in);
            n = sc.nextInt();
            A = new int[n];
            
            for(int i=0; i < n; i++) A[i] = sc.nextInt();
        
            trace();
        
            //insetion sort
        for (int 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;     
            trace();
        }
      
    }
        
        void trace(){         
                for (int i= 0;i<n;i++){
                    if (i > 0) System.out.print(" ");
                        System.out.print(A[i]);
                    }
                
                System.out.println();  
        }

           public static void main(String[] args){     
               new Main().run();
    } 
} Main int n n v v j; j int[] A; A public void run(){
        Scanner sc =  new Scanner(System.in);
            n = sc.nextInt();
            A = new int[n];
            
            for(int i=0; i < n; i++) A[i] = sc.nextInt();
        
            trace();
        
            //insetion sort
        for (int 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;     
            trace();
        }
      
    } run {
        Scanner sc =  new Scanner(System.in);
            n = sc.nextInt();
            A = new int[n];
            
            for(int i=0; i < n; i++) A[i] = sc.nextInt();
        
            trace();
        
            //insetion sort
        for (int 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;     
            trace();
        }
      
    } Scanner sc =  new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc A = new int[n] A new int[n] n for(int i=0; i < n; i++) A[i] = sc.nextInt(); int i=0; int i=0; i 0 i < n i n i++ i++ i A[i] = sc.nextInt(); A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc trace() trace for (int 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;     
            trace();
        } int i=1; int 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;     
            trace();
        } {
            v=A[i];
            j=i-1;
            while(j>=0&&A[j]>v){
                A[j+1]=A[j];
                j--;
            }
            A[j+1]=v;     
            trace();
        } 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 trace() trace void trace(){         
                for (int i= 0;i<n;i++){
                    if (i > 0) System.out.print(" ");
                        System.out.print(A[i]);
                    }
                
                System.out.println();  
        } trace {         
                for (int i= 0;i<n;i++){
                    if (i > 0) System.out.print(" ");
                        System.out.print(A[i]);
                    }
                
                System.out.println();  
        } for (int i= 0;i<n;i++){
                    if (i > 0) System.out.print(" ");
                        System.out.print(A[i]);
                    } int i= 0; int 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 public static void main(String[] args){     
               new Main().run();
    } main {     
               new Main().run();
    } new Main().run() new Main().run new Main() String[] args args public class Main{

        int n,v,j;
        int[] A;
    public void run(){
        Scanner sc =  new Scanner(System.in);
            n = sc.nextInt();
            A = new int[n];
            
            for(int i=0; i < n; i++) A[i] = sc.nextInt();
        
            trace();
        
            //insetion sort
        for (int 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;     
            trace();
        }
      
    }
        
        void trace(){         
                for (int i= 0;i<n;i++){
                    if (i > 0) System.out.print(" ");
                        System.out.print(A[i]);
                    }
                
                System.out.println();  
        }

           public static void main(String[] args){     
               new Main().run();
    } 
} public class Main{

        int n,v,j;
        int[] A;
    public void run(){
        Scanner sc =  new Scanner(System.in);
            n = sc.nextInt();
            A = new int[n];
            
            for(int i=0; i < n; i++) A[i] = sc.nextInt();
        
            trace();
        
            //insetion sort
        for (int 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;     
            trace();
        }
      
    }
        
        void trace(){         
                for (int i= 0;i<n;i++){
                    if (i > 0) System.out.print(" ");
                        System.out.print(A[i]);
                    }
                
                System.out.println();  
        }

           public static void main(String[] args){     
               new Main().run();
    } 
} Main
import java.util.Scanner;
public class Main{

        int n,v,j;
        int[] A;
    public void run(){
        Scanner sc =  new Scanner(System.in);
            n = sc.nextInt();
            A = new int[n];
            
            for(int i=0; i < n; i++) A[i] = sc.nextInt();
        
            trace();
        
            //insetion sort
        for (int 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;     
            trace();
        }
      
    }
        
        void trace(){         
                for (int i= 0;i<n;i++){
                    if (i > 0) System.out.print(" ");
                        System.out.print(A[i]);
                    }
                
                System.out.println();  
        }

           public static void main(String[] args){     
               new Main().run();
    } 
}