
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner =new Scanner(System.in);
        int N=scanner.nextInt();
        int[] ints=new int[N];
        for(int i=0;i<N;i++){
            ints[i]=scanner.nextInt();
        }
        for(int i=1;i<N;i++){
            for(int j=0;j<ints.length;j++){
                System.out.print(ints[j]);
                if(j!=ints.length-1){
                    System.out.print(" ");
                }
            }
            System.out.println("");
            int v=ints[i];
            int j=i-1;
            while(j>=0&&ints[j]>v){
                ints[j+1]=ints[j];
                j--;
            }
            ints[j+1]=v;
        }
        for(int j=0;j<ints.length;j++){
            System.out.print(ints[j]);
            if(j!=ints.length-1){
                System.out.print(" ");
            }
        }
        System.out.println("");
    }
}
 import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner =new Scanner(System.in);
        int N=scanner.nextInt();
        int[] ints=new int[N];
        for(int i=0;i<N;i++){
            ints[i]=scanner.nextInt();
        }
        for(int i=1;i<N;i++){
            for(int j=0;j<ints.length;j++){
                System.out.print(ints[j]);
                if(j!=ints.length-1){
                    System.out.print(" ");
                }
            }
            System.out.println("");
            int v=ints[i];
            int j=i-1;
            while(j>=0&&ints[j]>v){
                ints[j+1]=ints[j];
                j--;
            }
            ints[j+1]=v;
        }
        for(int j=0;j<ints.length;j++){
            System.out.print(ints[j]);
            if(j!=ints.length-1){
                System.out.print(" ");
            }
        }
        System.out.println("");
    }
} Main public static void main(String[] args) {
	// write your code here
        Scanner scanner =new Scanner(System.in);
        int N=scanner.nextInt();
        int[] ints=new int[N];
        for(int i=0;i<N;i++){
            ints[i]=scanner.nextInt();
        }
        for(int i=1;i<N;i++){
            for(int j=0;j<ints.length;j++){
                System.out.print(ints[j]);
                if(j!=ints.length-1){
                    System.out.print(" ");
                }
            }
            System.out.println("");
            int v=ints[i];
            int j=i-1;
            while(j>=0&&ints[j]>v){
                ints[j+1]=ints[j];
                j--;
            }
            ints[j+1]=v;
        }
        for(int j=0;j<ints.length;j++){
            System.out.print(ints[j]);
            if(j!=ints.length-1){
                System.out.print(" ");
            }
        }
        System.out.println("");
    } main {
	// write your code here
        Scanner scanner =new Scanner(System.in);
        int N=scanner.nextInt();
        int[] ints=new int[N];
        for(int i=0;i<N;i++){
            ints[i]=scanner.nextInt();
        }
        for(int i=1;i<N;i++){
            for(int j=0;j<ints.length;j++){
                System.out.print(ints[j]);
                if(j!=ints.length-1){
                    System.out.print(" ");
                }
            }
            System.out.println("");
            int v=ints[i];
            int j=i-1;
            while(j>=0&&ints[j]>v){
                ints[j+1]=ints[j];
                j--;
            }
            ints[j+1]=v;
        }
        for(int j=0;j<ints.length;j++){
            System.out.print(ints[j]);
            if(j!=ints.length-1){
                System.out.print(" ");
            }
        }
        System.out.println("");
    } Scanner scanner =new Scanner(System.in); scanner new Scanner(System.in) int N=scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int[] ints=new int[N]; ints new int[N] N for(int i=0;i<N;i++){
            ints[i]=scanner.nextInt();
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            ints[i]=scanner.nextInt();
        } {
            ints[i]=scanner.nextInt();
        } ints[i]=scanner.nextInt() ints[i] ints i scanner.nextInt() scanner.nextInt scanner for(int i=1;i<N;i++){
            for(int j=0;j<ints.length;j++){
                System.out.print(ints[j]);
                if(j!=ints.length-1){
                    System.out.print(" ");
                }
            }
            System.out.println("");
            int v=ints[i];
            int j=i-1;
            while(j>=0&&ints[j]>v){
                ints[j+1]=ints[j];
                j--;
            }
            ints[j+1]=v;
        } int i=1; int i=1; i 1 i<N i N i++ i++ i {
            for(int j=0;j<ints.length;j++){
                System.out.print(ints[j]);
                if(j!=ints.length-1){
                    System.out.print(" ");
                }
            }
            System.out.println("");
            int v=ints[i];
            int j=i-1;
            while(j>=0&&ints[j]>v){
                ints[j+1]=ints[j];
                j--;
            }
            ints[j+1]=v;
        } {
            for(int j=0;j<ints.length;j++){
                System.out.print(ints[j]);
                if(j!=ints.length-1){
                    System.out.print(" ");
                }
            }
            System.out.println("");
            int v=ints[i];
            int j=i-1;
            while(j>=0&&ints[j]>v){
                ints[j+1]=ints[j];
                j--;
            }
            ints[j+1]=v;
        } for(int j=0;j<ints.length;j++){
                System.out.print(ints[j]);
                if(j!=ints.length-1){
                    System.out.print(" ");
                }
            } int j=0; int j=0; j 0 j<ints.length j ints.length ints ints.length j++ j++ j {
                System.out.print(ints[j]);
                if(j!=ints.length-1){
                    System.out.print(" ");
                }
            } {
                System.out.print(ints[j]);
                if(j!=ints.length-1){
                    System.out.print(" ");
                }
            } System.out.print(ints[j]) System.out.print System.out System System.out ints[j] ints j if(j!=ints.length-1){
                    System.out.print(" ");
                } j!=ints.length-1 j ints.length-1 ints.length ints ints.length 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=ints[i]; v ints[i] ints i int j=i-1; j i-1 i 1 while(j>=0&&ints[j]>v){
                ints[j+1]=ints[j];
                j--;
            } j>=0&&ints[j]>v j>=0 j 0 ints[j]>v ints[j] ints j v {
                ints[j+1]=ints[j];
                j--;
            } ints[j+1]=ints[j] ints[j+1] ints j+1 j 1 ints[j] ints j j-- j ints[j+1]=v ints[j+1] ints j+1 j 1 v for(int j=0;j<ints.length;j++){
            System.out.print(ints[j]);
            if(j!=ints.length-1){
                System.out.print(" ");
            }
        } int j=0; int j=0; j 0 j<ints.length j ints.length ints ints.length j++ j++ j {
            System.out.print(ints[j]);
            if(j!=ints.length-1){
                System.out.print(" ");
            }
        } {
            System.out.print(ints[j]);
            if(j!=ints.length-1){
                System.out.print(" ");
            }
        } System.out.print(ints[j]) System.out.print System.out System System.out ints[j] ints j if(j!=ints.length-1){
                System.out.print(" ");
            } j!=ints.length-1 j ints.length-1 ints.length ints ints.length 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 public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner =new Scanner(System.in);
        int N=scanner.nextInt();
        int[] ints=new int[N];
        for(int i=0;i<N;i++){
            ints[i]=scanner.nextInt();
        }
        for(int i=1;i<N;i++){
            for(int j=0;j<ints.length;j++){
                System.out.print(ints[j]);
                if(j!=ints.length-1){
                    System.out.print(" ");
                }
            }
            System.out.println("");
            int v=ints[i];
            int j=i-1;
            while(j>=0&&ints[j]>v){
                ints[j+1]=ints[j];
                j--;
            }
            ints[j+1]=v;
        }
        for(int j=0;j<ints.length;j++){
            System.out.print(ints[j]);
            if(j!=ints.length-1){
                System.out.print(" ");
            }
        }
        System.out.println("");
    }
} public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner =new Scanner(System.in);
        int N=scanner.nextInt();
        int[] ints=new int[N];
        for(int i=0;i<N;i++){
            ints[i]=scanner.nextInt();
        }
        for(int i=1;i<N;i++){
            for(int j=0;j<ints.length;j++){
                System.out.print(ints[j]);
                if(j!=ints.length-1){
                    System.out.print(" ");
                }
            }
            System.out.println("");
            int v=ints[i];
            int j=i-1;
            while(j>=0&&ints[j]>v){
                ints[j+1]=ints[j];
                j--;
            }
            ints[j+1]=v;
        }
        for(int j=0;j<ints.length;j++){
            System.out.print(ints[j]);
            if(j!=ints.length-1){
                System.out.print(" ");
            }
        }
        System.out.println("");
    }
} Main

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner =new Scanner(System.in);
        int N=scanner.nextInt();
        int[] ints=new int[N];
        for(int i=0;i<N;i++){
            ints[i]=scanner.nextInt();
        }
        for(int i=1;i<N;i++){
            for(int j=0;j<ints.length;j++){
                System.out.print(ints[j]);
                if(j!=ints.length-1){
                    System.out.print(" ");
                }
            }
            System.out.println("");
            int v=ints[i];
            int j=i-1;
            while(j>=0&&ints[j]>v){
                ints[j+1]=ints[j];
                j--;
            }
            ints[j+1]=v;
        }
        for(int j=0;j<ints.length;j++){
            System.out.print(ints[j]);
            if(j!=ints.length-1){
                System.out.print(" ");
            }
        }
        System.out.println("");
    }
}

