import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int[] a = new int[count];
        for (int i = 0; i < count; i++) {
            a[i] = sc.nextInt();
        }
        insertionSort(a);
    }

    private static int[] insertionSort(int[] a) {
        printArray(a);
        for (int i = 1; i < a.length; i++) {
            int target = a[i];
            int j = i - 1;
            while (j >= 0 && a[j] > target) {
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = target;
            printArray(a);
        }
        return a;
    }

    private static void printArray(int[] array) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < array.length; i++) {
            sb.append(array[i]);
            if (i != array.length - 1) {
                sb.append(" ");
            }
        }
        System.out.println(sb);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int[] a = new int[count];
        for (int i = 0; i < count; i++) {
            a[i] = sc.nextInt();
        }
        insertionSort(a);
    }

    private static int[] insertionSort(int[] a) {
        printArray(a);
        for (int i = 1; i < a.length; i++) {
            int target = a[i];
            int j = i - 1;
            while (j >= 0 && a[j] > target) {
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = target;
            printArray(a);
        }
        return a;
    }

    private static void printArray(int[] array) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < array.length; i++) {
            sb.append(array[i]);
            if (i != array.length - 1) {
                sb.append(" ");
            }
        }
        System.out.println(sb);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int[] a = new int[count];
        for (int i = 0; i < count; i++) {
            a[i] = sc.nextInt();
        }
        insertionSort(a);
    } main {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int[] a = new int[count];
        for (int i = 0; i < count; i++) {
            a[i] = sc.nextInt();
        }
        insertionSort(a);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int count = sc.nextInt(); count sc.nextInt() sc.nextInt sc int[] a = new int[count]; a new int[count] count for (int i = 0; i < count; i++) {
            a[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
            a[i] = sc.nextInt();
        } {
            a[i] = sc.nextInt();
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc insertionSort(a) insertionSort a String[] args args private static int[] insertionSort(int[] a) {
        printArray(a);
        for (int i = 1; i < a.length; i++) {
            int target = a[i];
            int j = i - 1;
            while (j >= 0 && a[j] > target) {
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = target;
            printArray(a);
        }
        return a;
    } insertionSort {
        printArray(a);
        for (int i = 1; i < a.length; i++) {
            int target = a[i];
            int j = i - 1;
            while (j >= 0 && a[j] > target) {
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = target;
            printArray(a);
        }
        return a;
    } printArray(a) printArray a for (int i = 1; i < a.length; i++) {
            int target = a[i];
            int j = i - 1;
            while (j >= 0 && a[j] > target) {
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = target;
            printArray(a);
        } int i = 1; int i = 1; i 1 i < a.length i a.length a a.length i++ i++ i {
            int target = a[i];
            int j = i - 1;
            while (j >= 0 && a[j] > target) {
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = target;
            printArray(a);
        } {
            int target = a[i];
            int j = i - 1;
            while (j >= 0 && a[j] > target) {
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = target;
            printArray(a);
        } int target = a[i]; target a[i] a i int j = i - 1; j i - 1 i 1 while (j >= 0 && a[j] > target) {
                a[j + 1] = a[j];
                j--;
            } j >= 0 && a[j] > target j >= 0 j 0 a[j] > target a[j] a j target {
                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] = target a[j + 1] a j + 1 j 1 target printArray(a) printArray a return a; a int[] a a private static void printArray(int[] array) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < array.length; i++) {
            sb.append(array[i]);
            if (i != array.length - 1) {
                sb.append(" ");
            }
        }
        System.out.println(sb);
    } printArray {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < array.length; i++) {
            sb.append(array[i]);
            if (i != array.length - 1) {
                sb.append(" ");
            }
        }
        System.out.println(sb);
    } StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int i = 0; i < array.length; i++) {
            sb.append(array[i]);
            if (i != array.length - 1) {
                sb.append(" ");
            }
        } int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i++ i++ i {
            sb.append(array[i]);
            if (i != array.length - 1) {
                sb.append(" ");
            }
        } {
            sb.append(array[i]);
            if (i != array.length - 1) {
                sb.append(" ");
            }
        } sb.append(array[i]) sb.append sb array[i] array i if (i != array.length - 1) {
                sb.append(" ");
            } i != array.length - 1 i array.length - 1 array.length array array.length 1 {
                sb.append(" ");
            } sb.append(" ") sb.append sb " " System.out.println(sb) System.out.println System.out System System.out sb int[] array array public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int[] a = new int[count];
        for (int i = 0; i < count; i++) {
            a[i] = sc.nextInt();
        }
        insertionSort(a);
    }

    private static int[] insertionSort(int[] a) {
        printArray(a);
        for (int i = 1; i < a.length; i++) {
            int target = a[i];
            int j = i - 1;
            while (j >= 0 && a[j] > target) {
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = target;
            printArray(a);
        }
        return a;
    }

    private static void printArray(int[] array) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < array.length; i++) {
            sb.append(array[i]);
            if (i != array.length - 1) {
                sb.append(" ");
            }
        }
        System.out.println(sb);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int[] a = new int[count];
        for (int i = 0; i < count; i++) {
            a[i] = sc.nextInt();
        }
        insertionSort(a);
    }

    private static int[] insertionSort(int[] a) {
        printArray(a);
        for (int i = 1; i < a.length; i++) {
            int target = a[i];
            int j = i - 1;
            while (j >= 0 && a[j] > target) {
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = target;
            printArray(a);
        }
        return a;
    }

    private static void printArray(int[] array) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < array.length; i++) {
            sb.append(array[i]);
            if (i != array.length - 1) {
                sb.append(" ");
            }
        }
        System.out.println(sb);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int[] a = new int[count];
        for (int i = 0; i < count; i++) {
            a[i] = sc.nextInt();
        }
        insertionSort(a);
    }

    private static int[] insertionSort(int[] a) {
        printArray(a);
        for (int i = 1; i < a.length; i++) {
            int target = a[i];
            int j = i - 1;
            while (j >= 0 && a[j] > target) {
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = target;
            printArray(a);
        }
        return a;
    }

    private static void printArray(int[] array) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < array.length; i++) {
            sb.append(array[i]);
            if (i != array.length - 1) {
                sb.append(" ");
            }
        }
        System.out.println(sb);
    }
}