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

public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
        int a=Integer.parseInt(bf.readLine());
        int[] h=new int[a];

        String[] str=bf.readLine().split(" ");
        for(int i=0;i<a;i++){
            h[i]=Integer.parseInt(str[i]);
        }
        str.clone();
        Sort(h,a);
    }


    public static void Sort(int[] a, int b){
        int j,v;

        for(int i=0; i<a.length; i++){
            v=a[i];
            j=i-1;

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

    }

    public static void toArray(int[] h){
        StringBuilder sb=new StringBuilder();

        for(int i=0;i<h.length;i++){
            sb.append(h[i]);

            if(i<h.length-1)sb.append(" ");
        }
        System.out.println(sb);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
        int a=Integer.parseInt(bf.readLine());
        int[] h=new int[a];

        String[] str=bf.readLine().split(" ");
        for(int i=0;i<a;i++){
            h[i]=Integer.parseInt(str[i]);
        }
        str.clone();
        Sort(h,a);
    }


    public static void Sort(int[] a, int b){
        int j,v;

        for(int i=0; i<a.length; i++){
            v=a[i];
            j=i-1;

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

    }

    public static void toArray(int[] h){
        StringBuilder sb=new StringBuilder();

        for(int i=0;i<h.length;i++){
            sb.append(h[i]);

            if(i<h.length-1)sb.append(" ");
        }
        System.out.println(sb);
    }
} Main public static void main(String[] args) throws IOException{
        BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
        int a=Integer.parseInt(bf.readLine());
        int[] h=new int[a];

        String[] str=bf.readLine().split(" ");
        for(int i=0;i<a;i++){
            h[i]=Integer.parseInt(str[i]);
        }
        str.clone();
        Sort(h,a);
    } main {
        BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
        int a=Integer.parseInt(bf.readLine());
        int[] h=new int[a];

        String[] str=bf.readLine().split(" ");
        for(int i=0;i<a;i++){
            h[i]=Integer.parseInt(str[i]);
        }
        str.clone();
        Sort(h,a);
    } BufferedReader bf=new BufferedReader(new InputStreamReader(System.in)); bf new BufferedReader(new InputStreamReader(System.in)) int a=Integer.parseInt(bf.readLine()); a Integer.parseInt(bf.readLine()) Integer.parseInt Integer bf.readLine() bf.readLine bf int[] h=new int[a]; h new int[a] a String[] str=bf.readLine().split(" "); str bf.readLine().split(" ") bf.readLine().split bf.readLine() bf.readLine bf " " for(int i=0;i<a;i++){
            h[i]=Integer.parseInt(str[i]);
        } int i=0; int i=0; i 0 i<a i a i++ i++ i {
            h[i]=Integer.parseInt(str[i]);
        } {
            h[i]=Integer.parseInt(str[i]);
        } h[i]=Integer.parseInt(str[i]) h[i] h i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i str.clone() str.clone str Sort(h,a) Sort h a String[] args args public static void Sort(int[] a, int b){
        int j,v;

        for(int i=0; i<a.length; i++){
            v=a[i];
            j=i-1;

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

    } Sort {
        int j,v;

        for(int i=0; i<a.length; i++){
            v=a[i];
            j=i-1;

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

    } int j j v; v for(int i=0; i<a.length; i++){
            v=a[i];
            j=i-1;

            while(j>=0 && a[j]>v){
                a[j+1]=a[j];
                j--;
            }
            a[j+1]=v;
            toArray(a);
        } int i=0; int i=0; i 0 i<a.length i a.length a a.length 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;
            toArray(a);
        } {
            v=a[i];
            j=i-1;

            while(j>=0 && a[j]>v){
                a[j+1]=a[j];
                j--;
            }
            a[j+1]=v;
            toArray(a);
        } 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 toArray(a) toArray a int[] a a int b b public static void toArray(int[] h){
        StringBuilder sb=new StringBuilder();

        for(int i=0;i<h.length;i++){
            sb.append(h[i]);

            if(i<h.length-1)sb.append(" ");
        }
        System.out.println(sb);
    } toArray {
        StringBuilder sb=new StringBuilder();

        for(int i=0;i<h.length;i++){
            sb.append(h[i]);

            if(i<h.length-1)sb.append(" ");
        }
        System.out.println(sb);
    } StringBuilder sb=new StringBuilder(); sb new StringBuilder() for(int i=0;i<h.length;i++){
            sb.append(h[i]);

            if(i<h.length-1)sb.append(" ");
        } int i=0; int i=0; i 0 i<h.length i h.length h h.length i++ i++ i {
            sb.append(h[i]);

            if(i<h.length-1)sb.append(" ");
        } {
            sb.append(h[i]);

            if(i<h.length-1)sb.append(" ");
        } sb.append(h[i]) sb.append sb h[i] h i if(i<h.length-1)sb.append(" "); i<h.length-1 i h.length-1 h.length h h.length 1 sb.append(" ") sb.append sb " " System.out.println(sb) System.out.println System.out System System.out sb int[] h h public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
        int a=Integer.parseInt(bf.readLine());
        int[] h=new int[a];

        String[] str=bf.readLine().split(" ");
        for(int i=0;i<a;i++){
            h[i]=Integer.parseInt(str[i]);
        }
        str.clone();
        Sort(h,a);
    }


    public static void Sort(int[] a, int b){
        int j,v;

        for(int i=0; i<a.length; i++){
            v=a[i];
            j=i-1;

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

    }

    public static void toArray(int[] h){
        StringBuilder sb=new StringBuilder();

        for(int i=0;i<h.length;i++){
            sb.append(h[i]);

            if(i<h.length-1)sb.append(" ");
        }
        System.out.println(sb);
    }
} public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
        int a=Integer.parseInt(bf.readLine());
        int[] h=new int[a];

        String[] str=bf.readLine().split(" ");
        for(int i=0;i<a;i++){
            h[i]=Integer.parseInt(str[i]);
        }
        str.clone();
        Sort(h,a);
    }


    public static void Sort(int[] a, int b){
        int j,v;

        for(int i=0; i<a.length; i++){
            v=a[i];
            j=i-1;

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

    }

    public static void toArray(int[] h){
        StringBuilder sb=new StringBuilder();

        for(int i=0;i<h.length;i++){
            sb.append(h[i]);

            if(i<h.length-1)sb.append(" ");
        }
        System.out.println(sb);
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
        int a=Integer.parseInt(bf.readLine());
        int[] h=new int[a];

        String[] str=bf.readLine().split(" ");
        for(int i=0;i<a;i++){
            h[i]=Integer.parseInt(str[i]);
        }
        str.clone();
        Sort(h,a);
    }


    public static void Sort(int[] a, int b){
        int j,v;

        for(int i=0; i<a.length; i++){
            v=a[i];
            j=i-1;

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

    }

    public static void toArray(int[] h){
        StringBuilder sb=new StringBuilder();

        for(int i=0;i<h.length;i++){
            sb.append(h[i]);

            if(i<h.length-1)sb.append(" ");
        }
        System.out.println(sb);
    }
}