import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[sc.nextInt()];
        for(int i = 0,n = a.length;i < n;i++) a[i] = sc.nextInt();
        print(a);
        insertSort(a);
        sc.close();
    }

    private static void insertSort(int[] a){
        for(int i = 1,l = a.length;i < l;i++){
            int v = a[i],j = i - 1;
            while(j >= 0 && a[j] > v){
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = v;
            print(a);
        }
    }

    private static void print(int[] a){
        System.out.print(a[0]);
        for(int k = 1,l = a.length;k < l;k++) System.out.print(" " + a[k]);
        System.out.println();
    }

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

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[sc.nextInt()];
        for(int i = 0,n = a.length;i < n;i++) a[i] = sc.nextInt();
        print(a);
        insertSort(a);
        sc.close();
    }

    private static void insertSort(int[] a){
        for(int i = 1,l = a.length;i < l;i++){
            int v = a[i],j = i - 1;
            while(j >= 0 && a[j] > v){
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = v;
            print(a);
        }
    }

    private static void print(int[] a){
        System.out.print(a[0]);
        for(int k = 1,l = a.length;k < l;k++) System.out.print(" " + a[k]);
        System.out.println();
    }

} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[sc.nextInt()];
        for(int i = 0,n = a.length;i < n;i++) a[i] = sc.nextInt();
        print(a);
        insertSort(a);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[sc.nextInt()];
        for(int i = 0,n = a.length;i < n;i++) a[i] = sc.nextInt();
        print(a);
        insertSort(a);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a = new int[sc.nextInt()]; a new int[sc.nextInt()] sc.nextInt() sc.nextInt sc for(int i = 0,n = a.length;i < n;i++) a[i] = sc.nextInt(); int i = 0,n = a.length; int i = 0 i 0 n = a.length; n a.length a a.length i < n i n i++ i++ i a[i] = sc.nextInt(); a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc print(a) print a insertSort(a) insertSort a sc.close() sc.close sc String[] args args private static void insertSort(int[] a){
        for(int i = 1,l = a.length;i < l;i++){
            int v = a[i],j = i - 1;
            while(j >= 0 && a[j] > v){
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = v;
            print(a);
        }
    } insertSort {
        for(int i = 1,l = a.length;i < l;i++){
            int v = a[i],j = i - 1;
            while(j >= 0 && a[j] > v){
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = v;
            print(a);
        }
    } for(int i = 1,l = a.length;i < l;i++){
            int v = a[i],j = i - 1;
            while(j >= 0 && a[j] > v){
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = v;
            print(a);
        } int i = 1,l = a.length; int i = 1 i 1 l = a.length; l a.length a a.length i < l i l i++ i++ i {
            int v = a[i],j = i - 1;
            while(j >= 0 && a[j] > v){
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = v;
            print(a);
        } {
            int v = a[i],j = i - 1;
            while(j >= 0 && a[j] > v){
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = v;
            print(a);
        } int 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 print(a) print a int[] a a private static void print(int[] a){
        System.out.print(a[0]);
        for(int k = 1,l = a.length;k < l;k++) System.out.print(" " + a[k]);
        System.out.println();
    } print {
        System.out.print(a[0]);
        for(int k = 1,l = a.length;k < l;k++) System.out.print(" " + a[k]);
        System.out.println();
    } System.out.print(a[0]) System.out.print System.out System System.out a[0] a 0 for(int k = 1,l = a.length;k < l;k++) System.out.print(" " + a[k]); int k = 1,l = a.length; int k = 1 k 1 l = a.length; l a.length a a.length k < l k l k++ k++ k System.out.print(" " + a[k]); System.out.print(" " + a[k]) System.out.print System.out System System.out " " + a[k] " " a[k] a k System.out.println() System.out.println System.out System System.out int[] a a public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[sc.nextInt()];
        for(int i = 0,n = a.length;i < n;i++) a[i] = sc.nextInt();
        print(a);
        insertSort(a);
        sc.close();
    }

    private static void insertSort(int[] a){
        for(int i = 1,l = a.length;i < l;i++){
            int v = a[i],j = i - 1;
            while(j >= 0 && a[j] > v){
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = v;
            print(a);
        }
    }

    private static void print(int[] a){
        System.out.print(a[0]);
        for(int k = 1,l = a.length;k < l;k++) System.out.print(" " + a[k]);
        System.out.println();
    }

} public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[sc.nextInt()];
        for(int i = 0,n = a.length;i < n;i++) a[i] = sc.nextInt();
        print(a);
        insertSort(a);
        sc.close();
    }

    private static void insertSort(int[] a){
        for(int i = 1,l = a.length;i < l;i++){
            int v = a[i],j = i - 1;
            while(j >= 0 && a[j] > v){
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = v;
            print(a);
        }
    }

    private static void print(int[] a){
        System.out.print(a[0]);
        for(int k = 1,l = a.length;k < l;k++) System.out.print(" " + a[k]);
        System.out.println();
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[sc.nextInt()];
        for(int i = 0,n = a.length;i < n;i++) a[i] = sc.nextInt();
        print(a);
        insertSort(a);
        sc.close();
    }

    private static void insertSort(int[] a){
        for(int i = 1,l = a.length;i < l;i++){
            int v = a[i],j = i - 1;
            while(j >= 0 && a[j] > v){
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = v;
            print(a);
        }
    }

    private static void print(int[] a){
        System.out.print(a[0]);
        for(int k = 1,l = a.length;k < l;k++) System.out.print(" " + a[k]);
        System.out.println();
    }

}