import java.util.Scanner;
class Main{
    public static void main(String[]arge){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int []A=new int[n];
        for(int i=0; i<n; i++){
            A[i]=sc.nextInt();
        }
        
        for(int i=0; i<n; i++){
             int v=A[i];
             int j=i-1;
             while(j>=0 && A[j]>v){
                 A[j+1]=A[j];
                 j--;
             }
             A[j+1]=v;

             for(int k=0; k<n; k++){
                if(k>0)System.out.print(" ");
                System.out.print(A[k]);
             }
             System.out.println();
        }
       

        
    }
}      import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[]arge){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int []A=new int[n];
        for(int i=0; i<n; i++){
            A[i]=sc.nextInt();
        }
        
        for(int i=0; i<n; i++){
             int v=A[i];
             int j=i-1;
             while(j>=0 && A[j]>v){
                 A[j+1]=A[j];
                 j--;
             }
             A[j+1]=v;

             for(int k=0; k<n; k++){
                if(k>0)System.out.print(" ");
                System.out.print(A[k]);
             }
             System.out.println();
        }
       

        
    }
} Main public static void main(String[]arge){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int []A=new int[n];
        for(int i=0; i<n; i++){
            A[i]=sc.nextInt();
        }
        
        for(int i=0; i<n; i++){
             int v=A[i];
             int j=i-1;
             while(j>=0 && A[j]>v){
                 A[j+1]=A[j];
                 j--;
             }
             A[j+1]=v;

             for(int k=0; k<n; k++){
                if(k>0)System.out.print(" ");
                System.out.print(A[k]);
             }
             System.out.println();
        }
       

        
    } main {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int []A=new int[n];
        for(int i=0; i<n; i++){
            A[i]=sc.nextInt();
        }
        
        for(int i=0; i<n; i++){
             int v=A[i];
             int j=i-1;
             while(j>=0 && A[j]>v){
                 A[j+1]=A[j];
                 j--;
             }
             A[j+1]=v;

             for(int k=0; k<n; k++){
                if(k>0)System.out.print(" ");
                System.out.print(A[k]);
             }
             System.out.println();
        }
       

        
    } 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[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]=sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc for(int i=0; i<n; i++){
             int v=A[i];
             int j=i-1;
             while(j>=0 && A[j]>v){
                 A[j+1]=A[j];
                 j--;
             }
             A[j+1]=v;

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

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

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

             for(int k=0; k<n; k++){
                if(k>0)System.out.print(" ");
                System.out.print(A[k]);
             }
             System.out.println();
        }
       

        
    }
}     