import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner cin = new Scanner(System.in);
        int n = Integer.parseInt(cin.next());
        int[] array = new int [n];
        cin.nextLine();
        for (int i = 0; i < n; i++)
        {
            array[i] = cin.nextInt();
        }
        insertionSort(array, n);

    }

    public static void insertionSort(int[] A, int n)
    {
        int v;
        for(int i = 0; i < n; i++)
        {
            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 z = 0; z < n; z++)
            {
                System.out.print(A[z]);
                if (z != n - 1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
} import java.util.Scanner; Scanner java.util public class Main
{
    public static void main(String[] args)
    {
        Scanner cin = new Scanner(System.in);
        int n = Integer.parseInt(cin.next());
        int[] array = new int [n];
        cin.nextLine();
        for (int i = 0; i < n; i++)
        {
            array[i] = cin.nextInt();
        }
        insertionSort(array, n);

    }

    public static void insertionSort(int[] A, int n)
    {
        int v;
        for(int i = 0; i < n; i++)
        {
            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 z = 0; z < n; z++)
            {
                System.out.print(A[z]);
                if (z != n - 1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
} Main public static void main(String[] args)
    {
        Scanner cin = new Scanner(System.in);
        int n = Integer.parseInt(cin.next());
        int[] array = new int [n];
        cin.nextLine();
        for (int i = 0; i < n; i++)
        {
            array[i] = cin.nextInt();
        }
        insertionSort(array, n);

    } main {
        Scanner cin = new Scanner(System.in);
        int n = Integer.parseInt(cin.next());
        int[] array = new int [n];
        cin.nextLine();
        for (int i = 0; i < n; i++)
        {
            array[i] = cin.nextInt();
        }
        insertionSort(array, n);

    } Scanner cin = new Scanner(System.in); cin new Scanner(System.in) int n = Integer.parseInt(cin.next()); n Integer.parseInt(cin.next()) Integer.parseInt Integer cin.next() cin.next cin int[] array = new int [n]; array new int [n] n cin.nextLine() cin.nextLine cin for (int i = 0; i < n; i++)
        {
            array[i] = cin.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            array[i] = cin.nextInt();
        } {
            array[i] = cin.nextInt();
        } array[i] = cin.nextInt() array[i] array i cin.nextInt() cin.nextInt cin insertionSort(array, n) insertionSort array n String[] args args public static void insertionSort(int[] A, int n)
    {
        int v;
        for(int i = 0; i < n; i++)
        {
            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 z = 0; z < n; z++)
            {
                System.out.print(A[z]);
                if (z != n - 1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    } insertionSort {
        int v;
        for(int i = 0; i < n; i++)
        {
            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 z = 0; z < n; z++)
            {
                System.out.print(A[z]);
                if (z != n - 1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    } int v; v for(int i = 0; i < n; i++)
        {
            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 z = 0; z < n; z++)
            {
                System.out.print(A[z]);
                if (z != n - 1)
                    System.out.print(" ");
            }
            System.out.println();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            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 z = 0; z < n; z++)
            {
                System.out.print(A[z]);
                if (z != n - 1)
                    System.out.print(" ");
            }
            System.out.println();
        } {
            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 z = 0; z < n; z++)
            {
                System.out.print(A[z]);
                if (z != n - 1)
                    System.out.print(" ");
            }
            System.out.println();
        } 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 z = 0; z < n; z++)
            {
                System.out.print(A[z]);
                if (z != n - 1)
                    System.out.print(" ");
            } int z = 0; int z = 0; z 0 z < n z n z++ z++ z {
                System.out.print(A[z]);
                if (z != n - 1)
                    System.out.print(" ");
            } {
                System.out.print(A[z]);
                if (z != n - 1)
                    System.out.print(" ");
            } System.out.print(A[z]) System.out.print System.out System System.out A[z] A z if (z != n - 1)
                    System.out.print(" "); z != n - 1 z n - 1 n 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out int[] A A int n n public class Main
{
    public static void main(String[] args)
    {
        Scanner cin = new Scanner(System.in);
        int n = Integer.parseInt(cin.next());
        int[] array = new int [n];
        cin.nextLine();
        for (int i = 0; i < n; i++)
        {
            array[i] = cin.nextInt();
        }
        insertionSort(array, n);

    }

    public static void insertionSort(int[] A, int n)
    {
        int v;
        for(int i = 0; i < n; i++)
        {
            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 z = 0; z < n; z++)
            {
                System.out.print(A[z]);
                if (z != n - 1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
} public class Main
{
    public static void main(String[] args)
    {
        Scanner cin = new Scanner(System.in);
        int n = Integer.parseInt(cin.next());
        int[] array = new int [n];
        cin.nextLine();
        for (int i = 0; i < n; i++)
        {
            array[i] = cin.nextInt();
        }
        insertionSort(array, n);

    }

    public static void insertionSort(int[] A, int n)
    {
        int v;
        for(int i = 0; i < n; i++)
        {
            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 z = 0; z < n; z++)
            {
                System.out.print(A[z]);
                if (z != n - 1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
} Main
import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner cin = new Scanner(System.in);
        int n = Integer.parseInt(cin.next());
        int[] array = new int [n];
        cin.nextLine();
        for (int i = 0; i < n; i++)
        {
            array[i] = cin.nextInt();
        }
        insertionSort(array, n);

    }

    public static void insertionSort(int[] A, int n)
    {
        int v;
        for(int i = 0; i < n; i++)
        {
            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 z = 0; z < n; z++)
            {
                System.out.print(A[z]);
                if (z != n - 1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
}