import java.util.Scanner;
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int[] a = new int[x];
        for(int i = 0; i < a.length; i++){
            a[i] = sc.nextInt();
        }
        build(a);
        for(int i = 1; i < a.length; i++){
            int v = a[i];
            int j = i-1;
            while(j >=0 && a[j] > v){
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = v;
            build(a);
        }
    }
    
    public static void build(int[] a){
        StringBuilder out = new StringBuilder();
        for(int i = 0; i < a.length; i++){
            out.append(a[i]);
            if(i < a.length-1){
                out.append(" ");
            }
        }
        out.append("\n");
        System.out.print(out.toString());
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int[] a = new int[x];
        for(int i = 0; i < a.length; i++){
            a[i] = sc.nextInt();
        }
        build(a);
        for(int i = 1; i < a.length; i++){
            int v = a[i];
            int j = i-1;
            while(j >=0 && a[j] > v){
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = v;
            build(a);
        }
    }
    
    public static void build(int[] a){
        StringBuilder out = new StringBuilder();
        for(int i = 0; i < a.length; i++){
            out.append(a[i]);
            if(i < a.length-1){
                out.append(" ");
            }
        }
        out.append("\n");
        System.out.print(out.toString());
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int[] a = new int[x];
        for(int i = 0; i < a.length; i++){
            a[i] = sc.nextInt();
        }
        build(a);
        for(int i = 1; i < a.length; i++){
            int v = a[i];
            int j = i-1;
            while(j >=0 && a[j] > v){
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = v;
            build(a);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int[] a = new int[x];
        for(int i = 0; i < a.length; i++){
            a[i] = sc.nextInt();
        }
        build(a);
        for(int i = 1; i < a.length; i++){
            int v = a[i];
            int j = i-1;
            while(j >=0 && a[j] > v){
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = v;
            build(a);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int[] a = new int[x]; a new int[x] x for(int i = 0; i < a.length; i++){
            a[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
            a[i] = sc.nextInt();
        } {
            a[i] = sc.nextInt();
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc build(a) build a for(int i = 1; i < a.length; i++){
            int v = a[i];
            int j = i-1;
            while(j >=0 && a[j] > v){
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = v;
            build(a);
        } int i = 1; int i = 1; i 1 i < a.length i a.length a a.length i++ i++ i {
            int v = a[i];
            int j = i-1;
            while(j >=0 && a[j] > v){
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = v;
            build(a);
        } {
            int v = a[i];
            int j = i-1;
            while(j >=0 && a[j] > v){
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = v;
            build(a);
        } int 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 build(a) build a String[] args args public static void build(int[] a){
        StringBuilder out = new StringBuilder();
        for(int i = 0; i < a.length; i++){
            out.append(a[i]);
            if(i < a.length-1){
                out.append(" ");
            }
        }
        out.append("\n");
        System.out.print(out.toString());
    } build {
        StringBuilder out = new StringBuilder();
        for(int i = 0; i < a.length; i++){
            out.append(a[i]);
            if(i < a.length-1){
                out.append(" ");
            }
        }
        out.append("\n");
        System.out.print(out.toString());
    } StringBuilder out = new StringBuilder(); out new StringBuilder() for(int i = 0; i < a.length; i++){
            out.append(a[i]);
            if(i < a.length-1){
                out.append(" ");
            }
        } int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
            out.append(a[i]);
            if(i < a.length-1){
                out.append(" ");
            }
        } {
            out.append(a[i]);
            if(i < a.length-1){
                out.append(" ");
            }
        } out.append(a[i]) out.append out a[i] a i if(i < a.length-1){
                out.append(" ");
            } i < a.length-1 i a.length-1 a.length a a.length 1 {
                out.append(" ");
            } out.append(" ") out.append out " " out.append("\n") out.append out "\n" System.out.print(out.toString()) System.out.print System.out System System.out out.toString() out.toString out int[] a a public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int[] a = new int[x];
        for(int i = 0; i < a.length; i++){
            a[i] = sc.nextInt();
        }
        build(a);
        for(int i = 1; i < a.length; i++){
            int v = a[i];
            int j = i-1;
            while(j >=0 && a[j] > v){
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = v;
            build(a);
        }
    }
    
    public static void build(int[] a){
        StringBuilder out = new StringBuilder();
        for(int i = 0; i < a.length; i++){
            out.append(a[i]);
            if(i < a.length-1){
                out.append(" ");
            }
        }
        out.append("\n");
        System.out.print(out.toString());
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int[] a = new int[x];
        for(int i = 0; i < a.length; i++){
            a[i] = sc.nextInt();
        }
        build(a);
        for(int i = 1; i < a.length; i++){
            int v = a[i];
            int j = i-1;
            while(j >=0 && a[j] > v){
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = v;
            build(a);
        }
    }
    
    public static void build(int[] a){
        StringBuilder out = new StringBuilder();
        for(int i = 0; i < a.length; i++){
            out.append(a[i]);
            if(i < a.length-1){
                out.append(" ");
            }
        }
        out.append("\n");
        System.out.print(out.toString());
    }
} Main
import java.util.Scanner;
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int[] a = new int[x];
        for(int i = 0; i < a.length; i++){
            a[i] = sc.nextInt();
        }
        build(a);
        for(int i = 1; i < a.length; i++){
            int v = a[i];
            int j = i-1;
            while(j >=0 && a[j] > v){
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = v;
            build(a);
        }
    }
    
    public static void build(int[] a){
        StringBuilder out = new StringBuilder();
        for(int i = 0; i < a.length; i++){
            out.append(a[i]);
            if(i < a.length-1){
                out.append(" ");
            }
        }
        out.append("\n");
        System.out.print(out.toString());
    }
}