import java.util.Scanner;

public class Main {
    static void checkArray(int[] a){
        int i ;
        for( i = 0; i < a.length -1; i++){
                System.out.print(a[i] +" ");
        }
        System.out.print(a[i]);
        System.out.println();
    }
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        int[] arr = new int[N];
        for(int i = 0; i < N; i++) {
            arr[i] = sc.nextInt();
        }
        
        checkArray(arr);
        
        for(int i = 1; i <= N-1; i++) {
            int v = arr[i];
            int j = i - 1;
            while(j >= 0 && arr[j] > v ) {
                arr[j+1] = arr[j];
                j--;
            }
            arr[j+1] = v;
            checkArray(arr);
        }   
    }   
} import java.util.Scanner; Scanner java.util public class Main {
    static void checkArray(int[] a){
        int i ;
        for( i = 0; i < a.length -1; i++){
                System.out.print(a[i] +" ");
        }
        System.out.print(a[i]);
        System.out.println();
    }
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        int[] arr = new int[N];
        for(int i = 0; i < N; i++) {
            arr[i] = sc.nextInt();
        }
        
        checkArray(arr);
        
        for(int i = 1; i <= N-1; i++) {
            int v = arr[i];
            int j = i - 1;
            while(j >= 0 && arr[j] > v ) {
                arr[j+1] = arr[j];
                j--;
            }
            arr[j+1] = v;
            checkArray(arr);
        }   
    }   
} Main static void checkArray(int[] a){
        int i ;
        for( i = 0; i < a.length -1; i++){
                System.out.print(a[i] +" ");
        }
        System.out.print(a[i]);
        System.out.println();
    } checkArray {
        int i ;
        for( i = 0; i < a.length -1; i++){
                System.out.print(a[i] +" ");
        }
        System.out.print(a[i]);
        System.out.println();
    } int i ; i for( i = 0; i < a.length -1; i++){
                System.out.print(a[i] +" ");
        } i = 0; i = 0 i 0 i < a.length -1 i a.length -1 a.length a a.length 1 i++ i++ i {
                System.out.print(a[i] +" ");
        } {
                System.out.print(a[i] +" ");
        } System.out.print(a[i] +" ") System.out.print System.out System System.out a[i] +" " a[i] a i " " 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 public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        int[] arr = new int[N];
        for(int i = 0; i < N; i++) {
            arr[i] = sc.nextInt();
        }
        
        checkArray(arr);
        
        for(int i = 1; i <= N-1; i++) {
            int v = arr[i];
            int j = i - 1;
            while(j >= 0 && arr[j] > v ) {
                arr[j+1] = arr[j];
                j--;
            }
            arr[j+1] = v;
            checkArray(arr);
        }   
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        int[] arr = new int[N];
        for(int i = 0; i < N; i++) {
            arr[i] = sc.nextInt();
        }
        
        checkArray(arr);
        
        for(int i = 1; i <= N-1; i++) {
            int v = arr[i];
            int j = i - 1;
            while(j >= 0 && arr[j] > v ) {
                arr[j+1] = arr[j];
                j--;
            }
            arr[j+1] = v;
            checkArray(arr);
        }   
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] arr = new int[N]; arr new int[N] N for(int i = 0; i < N; i++) {
            arr[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            arr[i] = sc.nextInt();
        } {
            arr[i] = sc.nextInt();
        } arr[i] = sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc checkArray(arr) checkArray arr for(int i = 1; i <= N-1; i++) {
            int v = arr[i];
            int j = i - 1;
            while(j >= 0 && arr[j] > v ) {
                arr[j+1] = arr[j];
                j--;
            }
            arr[j+1] = v;
            checkArray(arr);
        } int i = 1; int i = 1; i 1 i <= N-1 i N-1 N 1 i++ i++ i {
            int v = arr[i];
            int j = i - 1;
            while(j >= 0 && arr[j] > v ) {
                arr[j+1] = arr[j];
                j--;
            }
            arr[j+1] = v;
            checkArray(arr);
        } {
            int v = arr[i];
            int j = i - 1;
            while(j >= 0 && arr[j] > v ) {
                arr[j+1] = arr[j];
                j--;
            }
            arr[j+1] = v;
            checkArray(arr);
        } int v = arr[i]; v arr[i] arr i int j = i - 1; j i - 1 i 1 while(j >= 0 && arr[j] > v ) {
                arr[j+1] = arr[j];
                j--;
            } j >= 0 && arr[j] > v j >= 0 j 0 arr[j] > v arr[j] arr j v {
                arr[j+1] = arr[j];
                j--;
            } arr[j+1] = arr[j] arr[j+1] arr j+1 j 1 arr[j] arr j j-- j arr[j+1] = v arr[j+1] arr j+1 j 1 v checkArray(arr) checkArray arr String[] args args public class Main {
    static void checkArray(int[] a){
        int i ;
        for( i = 0; i < a.length -1; i++){
                System.out.print(a[i] +" ");
        }
        System.out.print(a[i]);
        System.out.println();
    }
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        int[] arr = new int[N];
        for(int i = 0; i < N; i++) {
            arr[i] = sc.nextInt();
        }
        
        checkArray(arr);
        
        for(int i = 1; i <= N-1; i++) {
            int v = arr[i];
            int j = i - 1;
            while(j >= 0 && arr[j] > v ) {
                arr[j+1] = arr[j];
                j--;
            }
            arr[j+1] = v;
            checkArray(arr);
        }   
    }   
} public class Main {
    static void checkArray(int[] a){
        int i ;
        for( i = 0; i < a.length -1; i++){
                System.out.print(a[i] +" ");
        }
        System.out.print(a[i]);
        System.out.println();
    }
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        int[] arr = new int[N];
        for(int i = 0; i < N; i++) {
            arr[i] = sc.nextInt();
        }
        
        checkArray(arr);
        
        for(int i = 1; i <= N-1; i++) {
            int v = arr[i];
            int j = i - 1;
            while(j >= 0 && arr[j] > v ) {
                arr[j+1] = arr[j];
                j--;
            }
            arr[j+1] = v;
            checkArray(arr);
        }   
    }   
} Main
import java.util.Scanner;

public class Main {
    static void checkArray(int[] a){
        int i ;
        for( i = 0; i < a.length -1; i++){
                System.out.print(a[i] +" ");
        }
        System.out.print(a[i]);
        System.out.println();
    }
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        int[] arr = new int[N];
        for(int i = 0; i < N; i++) {
            arr[i] = sc.nextInt();
        }
        
        checkArray(arr);
        
        for(int i = 1; i <= N-1; i++) {
            int v = arr[i];
            int j = i - 1;
            while(j >= 0 && arr[j] > v ) {
                arr[j+1] = arr[j];
                j--;
            }
            arr[j+1] = v;
            checkArray(arr);
        }   
    }   
}