import java.util.Scanner;

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

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