import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        final int length = sc.nextInt();
        final int[] numbers = new int[length];

        for (int i = 0; i < length; i++) {
            numbers[i] = sc.nextInt();
        }

        output(numbers);

        for (int i = 1; i < length; i++) {
            final int temp = numbers[i];

            int j;
            for (j = i - 1; j >= 0 && numbers[j] > temp; j--) {
                numbers[j + 1] = numbers[j];
            }
            numbers[j + 1] = temp;
            output(numbers);
        }

        sc.close();
    }

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

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

    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        final int length = sc.nextInt();
        final int[] numbers = new int[length];

        for (int i = 0; i < length; i++) {
            numbers[i] = sc.nextInt();
        }

        output(numbers);

        for (int i = 1; i < length; i++) {
            final int temp = numbers[i];

            int j;
            for (j = i - 1; j >= 0 && numbers[j] > temp; j--) {
                numbers[j + 1] = numbers[j];
            }
            numbers[j + 1] = temp;
            output(numbers);
        }

        sc.close();
    }

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

} Main public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        final int length = sc.nextInt();
        final int[] numbers = new int[length];

        for (int i = 0; i < length; i++) {
            numbers[i] = sc.nextInt();
        }

        output(numbers);

        for (int i = 1; i < length; i++) {
            final int temp = numbers[i];

            int j;
            for (j = i - 1; j >= 0 && numbers[j] > temp; j--) {
                numbers[j + 1] = numbers[j];
            }
            numbers[j + 1] = temp;
            output(numbers);
        }

        sc.close();
    } main {
        final Scanner sc = new Scanner(System.in);
        final int length = sc.nextInt();
        final int[] numbers = new int[length];

        for (int i = 0; i < length; i++) {
            numbers[i] = sc.nextInt();
        }

        output(numbers);

        for (int i = 1; i < length; i++) {
            final int temp = numbers[i];

            int j;
            for (j = i - 1; j >= 0 && numbers[j] > temp; j--) {
                numbers[j + 1] = numbers[j];
            }
            numbers[j + 1] = temp;
            output(numbers);
        }

        sc.close();
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int length = sc.nextInt(); length sc.nextInt() sc.nextInt sc final int[] numbers = new int[length]; numbers new int[length] length for (int i = 0; i < length; i++) {
            numbers[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
            numbers[i] = sc.nextInt();
        } {
            numbers[i] = sc.nextInt();
        } numbers[i] = sc.nextInt() numbers[i] numbers i sc.nextInt() sc.nextInt sc output(numbers) output numbers for (int i = 1; i < length; i++) {
            final int temp = numbers[i];

            int j;
            for (j = i - 1; j >= 0 && numbers[j] > temp; j--) {
                numbers[j + 1] = numbers[j];
            }
            numbers[j + 1] = temp;
            output(numbers);
        } int i = 1; int i = 1; i 1 i < length i length i++ i++ i {
            final int temp = numbers[i];

            int j;
            for (j = i - 1; j >= 0 && numbers[j] > temp; j--) {
                numbers[j + 1] = numbers[j];
            }
            numbers[j + 1] = temp;
            output(numbers);
        } {
            final int temp = numbers[i];

            int j;
            for (j = i - 1; j >= 0 && numbers[j] > temp; j--) {
                numbers[j + 1] = numbers[j];
            }
            numbers[j + 1] = temp;
            output(numbers);
        } final int temp = numbers[i]; temp numbers[i] numbers i int j; j for (j = i - 1; j >= 0 && numbers[j] > temp; j--) {
                numbers[j + 1] = numbers[j];
            } j = i - 1; j = i - 1 j i - 1 i 1 j >= 0 && numbers[j] > temp j >= 0 j 0 numbers[j] > temp numbers[j] numbers j temp j-- j-- j {
                numbers[j + 1] = numbers[j];
            } {
                numbers[j + 1] = numbers[j];
            } numbers[j + 1] = numbers[j] numbers[j + 1] numbers j + 1 j 1 numbers[j] numbers j numbers[j + 1] = temp numbers[j + 1] numbers j + 1 j 1 temp output(numbers) output numbers sc.close() sc.close sc String[] args args public static void output(int[] numbers) {
        int i;
        for (i = 0; i < numbers.length - 1; i++) {
            System.out.print(numbers[i] + " ");
        }
        System.out.println(numbers[i]);
    } output {
        int i;
        for (i = 0; i < numbers.length - 1; i++) {
            System.out.print(numbers[i] + " ");
        }
        System.out.println(numbers[i]);
    } int i; i for (i = 0; i < numbers.length - 1; i++) {
            System.out.print(numbers[i] + " ");
        } i = 0; i = 0 i 0 i < numbers.length - 1 i numbers.length - 1 numbers.length numbers numbers.length 1 i++ i++ i {
            System.out.print(numbers[i] + " ");
        } {
            System.out.print(numbers[i] + " ");
        } System.out.print(numbers[i] + " ") System.out.print System.out System System.out numbers[i] + " " numbers[i] numbers i " " System.out.println(numbers[i]) System.out.println System.out System System.out numbers[i] numbers i int[] numbers numbers public class Main {

    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        final int length = sc.nextInt();
        final int[] numbers = new int[length];

        for (int i = 0; i < length; i++) {
            numbers[i] = sc.nextInt();
        }

        output(numbers);

        for (int i = 1; i < length; i++) {
            final int temp = numbers[i];

            int j;
            for (j = i - 1; j >= 0 && numbers[j] > temp; j--) {
                numbers[j + 1] = numbers[j];
            }
            numbers[j + 1] = temp;
            output(numbers);
        }

        sc.close();
    }

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

} public class Main {

    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        final int length = sc.nextInt();
        final int[] numbers = new int[length];

        for (int i = 0; i < length; i++) {
            numbers[i] = sc.nextInt();
        }

        output(numbers);

        for (int i = 1; i < length; i++) {
            final int temp = numbers[i];

            int j;
            for (j = i - 1; j >= 0 && numbers[j] > temp; j--) {
                numbers[j + 1] = numbers[j];
            }
            numbers[j + 1] = temp;
            output(numbers);
        }

        sc.close();
    }

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

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        final int length = sc.nextInt();
        final int[] numbers = new int[length];

        for (int i = 0; i < length; i++) {
            numbers[i] = sc.nextInt();
        }

        output(numbers);

        for (int i = 1; i < length; i++) {
            final int temp = numbers[i];

            int j;
            for (j = i - 1; j >= 0 && numbers[j] > temp; j--) {
                numbers[j + 1] = numbers[j];
            }
            numbers[j + 1] = temp;
            output(numbers);
        }

        sc.close();
    }

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

}

