import java.util.*;

public class Main
{

    public static Scanner in = new Scanner(System.in);

    public void print(int[] a)
    {
        for (int i = 0; i <a.length-1 ; i++)
        {
            System.out.print(a[i]+" ");
        }
        System.out.println(a[a.length-1]);
    }

    public int[] insert(int[] a)
    {

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

            while (j>=0 && a[j]>key)
            {
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = key;
            new Main().print(a);
        }
        return a;

    }

    public void go()
    {
        int N = in.nextInt();

        int[] box = new int[N];

        for (int i = 0; i < N; i++)
        {
            box[i] = in.nextInt();
        }

        new Main().insert(box);

    }

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

    }
} import java.util.*; util.* java public class Main
{

    public static Scanner in = new Scanner(System.in);

    public void print(int[] a)
    {
        for (int i = 0; i <a.length-1 ; i++)
        {
            System.out.print(a[i]+" ");
        }
        System.out.println(a[a.length-1]);
    }

    public int[] insert(int[] a)
    {

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

            while (j>=0 && a[j]>key)
            {
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = key;
            new Main().print(a);
        }
        return a;

    }

    public void go()
    {
        int N = in.nextInt();

        int[] box = new int[N];

        for (int i = 0; i < N; i++)
        {
            box[i] = in.nextInt();
        }

        new Main().insert(box);

    }

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

    }
} Main public static Scanner in = new Scanner(System.in); in new Scanner(System.in) public void print(int[] a)
    {
        for (int i = 0; i <a.length-1 ; i++)
        {
            System.out.print(a[i]+" ");
        }
        System.out.println(a[a.length-1]);
    } print {
        for (int i = 0; i <a.length-1 ; i++)
        {
            System.out.print(a[i]+" ");
        }
        System.out.println(a[a.length-1]);
    } for (int i = 0; i <a.length-1 ; i++)
        {
            System.out.print(a[i]+" ");
        } int i = 0; int i = 0; i 0 i <a.length-1 i a.length-1 a.length a a.length 1 i++ i++ i {
            System.out.print(a[i]+" ");
        } {
            System.out.print(a[i]+" ");
        } System.out.print(a[i]+" ") System.out.print System.out System System.out a[i]+" " a[i] a i " " System.out.println(a[a.length-1]) System.out.println System.out System System.out a[a.length-1] a a.length-1 a.length a a.length 1 int[] a a public int[] insert(int[] a)
    {

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

            while (j>=0 && a[j]>key)
            {
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = key;
            new Main().print(a);
        }
        return a;

    } insert {

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

            while (j>=0 && a[j]>key)
            {
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = key;
            new Main().print(a);
        }
        return a;

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

            while (j>=0 && a[j]>key)
            {
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = key;
            new Main().print(a);
        } int i = 0; int i = 0; i 0 i <a.length i a.length a a.length i++ i++ i {
            int key=a[i];
            int j=i-1;

            while (j>=0 && a[j]>key)
            {
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = key;
            new Main().print(a);
        } {
            int key=a[i];
            int j=i-1;

            while (j>=0 && a[j]>key)
            {
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = key;
            new Main().print(a);
        } int key=a[i]; key a[i] a i int j=i-1; j i-1 i 1 while (j>=0 && a[j]>key)
            {
                a[j+1] = a[j];
                j--;
            } j>=0 && a[j]>key j>=0 j 0 a[j]>key a[j] a j key {
                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] = key a[j+1] a j+1 j 1 key new Main().print(a) new Main().print new Main() a return a; a int[] a a public void go()
    {
        int N = in.nextInt();

        int[] box = new int[N];

        for (int i = 0; i < N; i++)
        {
            box[i] = in.nextInt();
        }

        new Main().insert(box);

    } go {
        int N = in.nextInt();

        int[] box = new int[N];

        for (int i = 0; i < N; i++)
        {
            box[i] = in.nextInt();
        }

        new Main().insert(box);

    } int N = in.nextInt(); N in.nextInt() in.nextInt in int[] box = new int[N]; box new int[N] N for (int i = 0; i < N; i++)
        {
            box[i] = in.nextInt();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            box[i] = in.nextInt();
        } {
            box[i] = in.nextInt();
        } box[i] = in.nextInt() box[i] box i in.nextInt() in.nextInt in new Main().insert(box) new Main().insert new Main() box public static void main(String[] args)
    {
        new Main().go();

    } main {
        new Main().go();

    } new Main().go() new Main().go new Main() String[] args args public class Main
{

    public static Scanner in = new Scanner(System.in);

    public void print(int[] a)
    {
        for (int i = 0; i <a.length-1 ; i++)
        {
            System.out.print(a[i]+" ");
        }
        System.out.println(a[a.length-1]);
    }

    public int[] insert(int[] a)
    {

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

            while (j>=0 && a[j]>key)
            {
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = key;
            new Main().print(a);
        }
        return a;

    }

    public void go()
    {
        int N = in.nextInt();

        int[] box = new int[N];

        for (int i = 0; i < N; i++)
        {
            box[i] = in.nextInt();
        }

        new Main().insert(box);

    }

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

    }
} public class Main
{

    public static Scanner in = new Scanner(System.in);

    public void print(int[] a)
    {
        for (int i = 0; i <a.length-1 ; i++)
        {
            System.out.print(a[i]+" ");
        }
        System.out.println(a[a.length-1]);
    }

    public int[] insert(int[] a)
    {

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

            while (j>=0 && a[j]>key)
            {
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = key;
            new Main().print(a);
        }
        return a;

    }

    public void go()
    {
        int N = in.nextInt();

        int[] box = new int[N];

        for (int i = 0; i < N; i++)
        {
            box[i] = in.nextInt();
        }

        new Main().insert(box);

    }

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

    }
} Main
import java.util.*;

public class Main
{

    public static Scanner in = new Scanner(System.in);

    public void print(int[] a)
    {
        for (int i = 0; i <a.length-1 ; i++)
        {
            System.out.print(a[i]+" ");
        }
        System.out.println(a[a.length-1]);
    }

    public int[] insert(int[] a)
    {

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

            while (j>=0 && a[j]>key)
            {
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = key;
            new Main().print(a);
        }
        return a;

    }

    public void go()
    {
        int N = in.nextInt();

        int[] box = new int[N];

        for (int i = 0; i < N; i++)
        {
            box[i] = in.nextInt();
        }

        new Main().insert(box);

    }

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

    }
}