import java.util.*;

public class Main {
    public 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;
            
            for(j=0; j<N; j++){
                System.out.print(A[j]);
                if(j!=N-1) System.out.print(" ");
            }
            System.out.println("");
        }
    }
    
    public static void main(String[] args) throws Exception {
        // Here your code !
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A[] = new int[100];
        
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
            System.out.print(A[i]);
            if(i != N-1) System.out.print(" ");
        }
        System.out.println("");
        
        insertionSort(A,N);
        
        
        
    }
} import java.util.*; util.* java public class Main {
    public 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;
            
            for(j=0; j<N; j++){
                System.out.print(A[j]);
                if(j!=N-1) System.out.print(" ");
            }
            System.out.println("");
        }
    }
    
    public static void main(String[] args) throws Exception {
        // Here your code !
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A[] = new int[100];
        
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
            System.out.print(A[i]);
            if(i != N-1) System.out.print(" ");
        }
        System.out.println("");
        
        insertionSort(A,N);
        
        
        
    }
} Main public 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;
            
            for(j=0; j<N; j++){
                System.out.print(A[j]);
                if(j!=N-1) System.out.print(" ");
            }
            System.out.println("");
        }
    } 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;
            
            for(j=0; j<N; j++){
                System.out.print(A[j]);
                if(j!=N-1) System.out.print(" ");
            }
            System.out.println("");
        }
    } 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;
            
            for(j=0; j<N; j++){
                System.out.print(A[j]);
                if(j!=N-1) System.out.print(" ");
            }
            System.out.println("");
        } 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;
            
            for(j=0; j<N; j++){
                System.out.print(A[j]);
                if(j!=N-1) System.out.print(" ");
            }
            System.out.println("");
        } {
            int v = A[i];
            int j = i-1;
            while(j>=0 && A[j]>v ){
                A[j+1] = A[j];
                j--;
            }
            A[j+1] = v;
            
            for(j=0; j<N; j++){
                System.out.print(A[j]);
                if(j!=N-1) System.out.print(" ");
            }
            System.out.println("");
        } 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 for(j=0; j<N; j++){
                System.out.print(A[j]);
                if(j!=N-1) System.out.print(" ");
            } j=0; j=0 j 0 j<N j N j++ j++ j {
                System.out.print(A[j]);
                if(j!=N-1) System.out.print(" ");
            } {
                System.out.print(A[j]);
                if(j!=N-1) System.out.print(" ");
            } System.out.print(A[j]) System.out.print System.out System System.out A[j] A j if(j!=N-1) System.out.print(" "); j!=N-1 j N-1 N 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.println("") System.out.println System.out System System.out "" int[] A A int N N public static void main(String[] args) throws Exception {
        // Here your code !
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A[] = new int[100];
        
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
            System.out.print(A[i]);
            if(i != N-1) System.out.print(" ");
        }
        System.out.println("");
        
        insertionSort(A,N);
        
        
        
    } main {
        // Here your code !
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A[] = new int[100];
        
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
            System.out.print(A[i]);
            if(i != N-1) System.out.print(" ");
        }
        System.out.println("");
        
        insertionSort(A,N);
        
        
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int A[] = new int[100]; A new int[100] 100 for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
            System.out.print(A[i]);
            if(i != N-1) System.out.print(" ");
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            A[i] = sc.nextInt();
            System.out.print(A[i]);
            if(i != N-1) System.out.print(" ");
        } {
            A[i] = sc.nextInt();
            System.out.print(A[i]);
            if(i != N-1) System.out.print(" ");
        } A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc System.out.print(A[i]) System.out.print System.out System System.out A[i] A i if(i != N-1) System.out.print(" "); i != N-1 i N-1 N 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.println("") System.out.println System.out System System.out "" insertionSort(A,N) insertionSort A N String[] args args public class Main {
    public 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;
            
            for(j=0; j<N; j++){
                System.out.print(A[j]);
                if(j!=N-1) System.out.print(" ");
            }
            System.out.println("");
        }
    }
    
    public static void main(String[] args) throws Exception {
        // Here your code !
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A[] = new int[100];
        
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
            System.out.print(A[i]);
            if(i != N-1) System.out.print(" ");
        }
        System.out.println("");
        
        insertionSort(A,N);
        
        
        
    }
} public class Main {
    public 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;
            
            for(j=0; j<N; j++){
                System.out.print(A[j]);
                if(j!=N-1) System.out.print(" ");
            }
            System.out.println("");
        }
    }
    
    public static void main(String[] args) throws Exception {
        // Here your code !
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A[] = new int[100];
        
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
            System.out.print(A[i]);
            if(i != N-1) System.out.print(" ");
        }
        System.out.println("");
        
        insertionSort(A,N);
        
        
        
    }
} Main
import java.util.*;

public class Main {
    public 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;
            
            for(j=0; j<N; j++){
                System.out.print(A[j]);
                if(j!=N-1) System.out.print(" ");
            }
            System.out.println("");
        }
    }
    
    public static void main(String[] args) throws Exception {
        // Here your code !
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A[] = new int[100];
        
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
            System.out.print(A[i]);
            if(i != N-1) System.out.print(" ");
        }
        System.out.println("");
        
        insertionSort(A,N);
        
        
        
    }
}