import java.util.Scanner;

public class Main{

   static void trace(int A[],int N){
        for (int i = 0; i<N;i++){
            if (i>0) System.out.print(" ");
            System.out.print(A[i]);
        }
        System.out.println();
    }
   static void insertionsort(int A[],int N){
        for (int i = 1; i<N;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;
            trace(A,N);
        }
    }

    public static void main(String[]args){
        int A[] = new int[100];
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        for (int i = 0; i<N; i++){
            A[i] = scanner.nextInt();
        }

        trace(A,N);
        insertionsort(A,N);
    }
}
 import java.util.Scanner; Scanner java.util public class Main{

   static void trace(int A[],int N){
        for (int i = 0; i<N;i++){
            if (i>0) System.out.print(" ");
            System.out.print(A[i]);
        }
        System.out.println();
    }
   static void insertionsort(int A[],int N){
        for (int i = 1; i<N;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;
            trace(A,N);
        }
    }

    public static void main(String[]args){
        int A[] = new int[100];
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        for (int i = 0; i<N; i++){
            A[i] = scanner.nextInt();
        }

        trace(A,N);
        insertionsort(A,N);
    }
} Main static void trace(int A[],int N){
        for (int i = 0; i<N;i++){
            if (i>0) System.out.print(" ");
            System.out.print(A[i]);
        }
        System.out.println();
    } trace {
        for (int i = 0; i<N;i++){
            if (i>0) System.out.print(" ");
            System.out.print(A[i]);
        }
        System.out.println();
    } for (int i = 0; i<N;i++){
            if (i>0) System.out.print(" ");
            System.out.print(A[i]);
        } int i = 0; int i = 0; i 0 i<N i N i++ i++ i {
            if (i>0) System.out.print(" ");
            System.out.print(A[i]);
        } {
            if (i>0) System.out.print(" ");
            System.out.print(A[i]);
        } if (i>0) System.out.print(" "); i>0 i 0 System.out.print(" ") System.out.print System.out System System.out " " System.out.print(A[i]) System.out.print System.out System System.out A[i] A i System.out.println() System.out.println System.out System System.out int A[] A int N N static void insertionsort(int A[],int N){
        for (int i = 1; i<N;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;
            trace(A,N);
        }
    } insertionsort {
        for (int i = 1; i<N;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;
            trace(A,N);
        }
    } for (int i = 1; i<N;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;
            trace(A,N);
        } int i = 1; int i = 1; i 1 i<N i N 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;
            trace(A,N);
        } {
            int v =  A[i];
            int j = i-1;
            while (j>=0&&A[j]>v){
                A[j+1] = A[j];
                j--;
            }
            A[j+1] = v;
            trace(A,N);
        } 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 trace(A,N) trace A N int A[] A int N N public static void main(String[]args){
        int A[] = new int[100];
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        for (int i = 0; i<N; i++){
            A[i] = scanner.nextInt();
        }

        trace(A,N);
        insertionsort(A,N);
    } main {
        int A[] = new int[100];
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        for (int i = 0; i<N; i++){
            A[i] = scanner.nextInt();
        }

        trace(A,N);
        insertionsort(A,N);
    } int A[] = new int[100]; A new int[100] 100 Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner for (int i = 0; i<N; i++){
            A[i] = scanner.nextInt();
        } int i = 0; int i = 0; i 0 i<N i N i++ i++ i {
            A[i] = scanner.nextInt();
        } {
            A[i] = scanner.nextInt();
        } A[i] = scanner.nextInt() A[i] A i scanner.nextInt() scanner.nextInt scanner trace(A,N) trace A N insertionsort(A,N) insertionsort A N String[]args args public class Main{

   static void trace(int A[],int N){
        for (int i = 0; i<N;i++){
            if (i>0) System.out.print(" ");
            System.out.print(A[i]);
        }
        System.out.println();
    }
   static void insertionsort(int A[],int N){
        for (int i = 1; i<N;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;
            trace(A,N);
        }
    }

    public static void main(String[]args){
        int A[] = new int[100];
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        for (int i = 0; i<N; i++){
            A[i] = scanner.nextInt();
        }

        trace(A,N);
        insertionsort(A,N);
    }
} public class Main{

   static void trace(int A[],int N){
        for (int i = 0; i<N;i++){
            if (i>0) System.out.print(" ");
            System.out.print(A[i]);
        }
        System.out.println();
    }
   static void insertionsort(int A[],int N){
        for (int i = 1; i<N;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;
            trace(A,N);
        }
    }

    public static void main(String[]args){
        int A[] = new int[100];
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        for (int i = 0; i<N; i++){
            A[i] = scanner.nextInt();
        }

        trace(A,N);
        insertionsort(A,N);
    }
} Main
import java.util.Scanner;

public class Main{

   static void trace(int A[],int N){
        for (int i = 0; i<N;i++){
            if (i>0) System.out.print(" ");
            System.out.print(A[i]);
        }
        System.out.println();
    }
   static void insertionsort(int A[],int N){
        for (int i = 1; i<N;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;
            trace(A,N);
        }
    }

    public static void main(String[]args){
        int A[] = new int[100];
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        for (int i = 0; i<N; i++){
            A[i] = scanner.nextInt();
        }

        trace(A,N);
        insertionsort(A,N);
    }
}

