import java.util.Scanner;

public class Main {
    public static Scanner sc;
    public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] ary = new int[n];
        for (int i=0; i<n; i++) {
            ary[i] = sc.nextInt();
        }
        
        for (int i=0; i<n; i++) {
            int val = ary[i];
            for (int j=i-1; j>-1; j--) {
                if (ary[j+1] < ary[j]) {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } else {
                    break;
                }
            }
            for (int k=0;k<n;k++) {
                System.out.print(ary[k]);
                if (k!=n-1) {
                    System.out.print(" ");
                } else {
                    System.out.println("");
                }
            }
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static Scanner sc;
    public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] ary = new int[n];
        for (int i=0; i<n; i++) {
            ary[i] = sc.nextInt();
        }
        
        for (int i=0; i<n; i++) {
            int val = ary[i];
            for (int j=i-1; j>-1; j--) {
                if (ary[j+1] < ary[j]) {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } else {
                    break;
                }
            }
            for (int k=0;k<n;k++) {
                System.out.print(ary[k]);
                if (k!=n-1) {
                    System.out.print(" ");
                } else {
                    System.out.println("");
                }
            }
        }
    }
} Main public static Scanner sc; sc public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] ary = new int[n];
        for (int i=0; i<n; i++) {
            ary[i] = sc.nextInt();
        }
        
        for (int i=0; i<n; i++) {
            int val = ary[i];
            for (int j=i-1; j>-1; j--) {
                if (ary[j+1] < ary[j]) {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } else {
                    break;
                }
            }
            for (int k=0;k<n;k++) {
                System.out.print(ary[k]);
                if (k!=n-1) {
                    System.out.print(" ");
                } else {
                    System.out.println("");
                }
            }
        }
    } main {
        sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] ary = new int[n];
        for (int i=0; i<n; i++) {
            ary[i] = sc.nextInt();
        }
        
        for (int i=0; i<n; i++) {
            int val = ary[i];
            for (int j=i-1; j>-1; j--) {
                if (ary[j+1] < ary[j]) {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } else {
                    break;
                }
            }
            for (int k=0;k<n;k++) {
                System.out.print(ary[k]);
                if (k!=n-1) {
                    System.out.print(" ");
                } else {
                    System.out.println("");
                }
            }
        }
    } sc = new Scanner(System.in) sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] ary = new int[n]; ary new int[n] n for (int i=0; i<n; i++) {
            ary[i] = sc.nextInt();
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            ary[i] = sc.nextInt();
        } {
            ary[i] = sc.nextInt();
        } ary[i] = sc.nextInt() ary[i] ary i sc.nextInt() sc.nextInt sc for (int i=0; i<n; i++) {
            int val = ary[i];
            for (int j=i-1; j>-1; j--) {
                if (ary[j+1] < ary[j]) {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } else {
                    break;
                }
            }
            for (int k=0;k<n;k++) {
                System.out.print(ary[k]);
                if (k!=n-1) {
                    System.out.print(" ");
                } else {
                    System.out.println("");
                }
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            int val = ary[i];
            for (int j=i-1; j>-1; j--) {
                if (ary[j+1] < ary[j]) {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } else {
                    break;
                }
            }
            for (int k=0;k<n;k++) {
                System.out.print(ary[k]);
                if (k!=n-1) {
                    System.out.print(" ");
                } else {
                    System.out.println("");
                }
            }
        } {
            int val = ary[i];
            for (int j=i-1; j>-1; j--) {
                if (ary[j+1] < ary[j]) {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } else {
                    break;
                }
            }
            for (int k=0;k<n;k++) {
                System.out.print(ary[k]);
                if (k!=n-1) {
                    System.out.print(" ");
                } else {
                    System.out.println("");
                }
            }
        } int val = ary[i]; val ary[i] ary i for (int j=i-1; j>-1; j--) {
                if (ary[j+1] < ary[j]) {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } else {
                    break;
                }
            } int j=i-1; int j=i-1; j i-1 i 1 j>-1 j -1 1 j-- j-- j {
                if (ary[j+1] < ary[j]) {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } else {
                    break;
                }
            } {
                if (ary[j+1] < ary[j]) {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } else {
                    break;
                }
            } if (ary[j+1] < ary[j]) {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } else {
                    break;
                } ary[j+1] < ary[j] ary[j+1] ary j+1 j 1 ary[j] ary j {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } ary[j+1] = ary[j] ary[j+1] ary j+1 j 1 ary[j] ary j ary[j] = val ary[j] ary j val {
                    break;
                } break; for (int k=0;k<n;k++) {
                System.out.print(ary[k]);
                if (k!=n-1) {
                    System.out.print(" ");
                } else {
                    System.out.println("");
                }
            } int k=0; int k=0; k 0 k<n k n k++ k++ k {
                System.out.print(ary[k]);
                if (k!=n-1) {
                    System.out.print(" ");
                } else {
                    System.out.println("");
                }
            } {
                System.out.print(ary[k]);
                if (k!=n-1) {
                    System.out.print(" ");
                } else {
                    System.out.println("");
                }
            } System.out.print(ary[k]) System.out.print System.out System System.out ary[k] ary k if (k!=n-1) {
                    System.out.print(" ");
                } else {
                    System.out.println("");
                } k!=n-1 k n-1 n 1 {
                    System.out.print(" ");
                } System.out.print(" ") System.out.print System.out System System.out " " {
                    System.out.println("");
                } System.out.println("") System.out.println System.out System System.out "" String[] args args public class Main {
    public static Scanner sc;
    public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] ary = new int[n];
        for (int i=0; i<n; i++) {
            ary[i] = sc.nextInt();
        }
        
        for (int i=0; i<n; i++) {
            int val = ary[i];
            for (int j=i-1; j>-1; j--) {
                if (ary[j+1] < ary[j]) {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } else {
                    break;
                }
            }
            for (int k=0;k<n;k++) {
                System.out.print(ary[k]);
                if (k!=n-1) {
                    System.out.print(" ");
                } else {
                    System.out.println("");
                }
            }
        }
    }
} public class Main {
    public static Scanner sc;
    public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] ary = new int[n];
        for (int i=0; i<n; i++) {
            ary[i] = sc.nextInt();
        }
        
        for (int i=0; i<n; i++) {
            int val = ary[i];
            for (int j=i-1; j>-1; j--) {
                if (ary[j+1] < ary[j]) {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } else {
                    break;
                }
            }
            for (int k=0;k<n;k++) {
                System.out.print(ary[k]);
                if (k!=n-1) {
                    System.out.print(" ");
                } else {
                    System.out.println("");
                }
            }
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static Scanner sc;
    public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] ary = new int[n];
        for (int i=0; i<n; i++) {
            ary[i] = sc.nextInt();
        }
        
        for (int i=0; i<n; i++) {
            int val = ary[i];
            for (int j=i-1; j>-1; j--) {
                if (ary[j+1] < ary[j]) {
                    ary[j+1] = ary[j];
                    ary[j] = val;
                } else {
                    break;
                }
            }
            for (int k=0;k<n;k++) {
                System.out.print(ary[k]);
                if (k!=n-1) {
                    System.out.print(" ");
                } else {
                    System.out.println("");
                }
            }
        }
    }
}