import java.util.*;

public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int number = Integer.parseInt(line);
        
        String line2 = sc.nextLine();
        String[] line2sp = new String[number];
    	line2sp=line2.split(" ");
    	int[] figArray = new int[number];
    	int[] afterSort = new int[number];
    	
    	 for(int i=0;i<number;i++){
    		 figArray[i]=Integer.parseInt(line2sp[i]);
    		 afterSort[i]=0;
    		 
         }    	 
    	 
    	 int insert=-1;
    	 
    	 for(int i=0;i<number;i++){
    		 insert=figArray[i];
    		 int j=i-1;
    		 
    		 while(j>=0&&figArray[j]>insert){
    			 figArray[j+1]=figArray[j];
    			 j--;
    			 figArray[j+1]=insert;
    		 }
    		 
    		 
    		 for(int k=0;k<number-1;k++){
    			 System.out.print(figArray[k]+" ");
    		 }
    		 System.out.println(figArray[number-1]);
    		 
    	 }
    }   
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int number = Integer.parseInt(line);
        
        String line2 = sc.nextLine();
        String[] line2sp = new String[number];
    	line2sp=line2.split(" ");
    	int[] figArray = new int[number];
    	int[] afterSort = new int[number];
    	
    	 for(int i=0;i<number;i++){
    		 figArray[i]=Integer.parseInt(line2sp[i]);
    		 afterSort[i]=0;
    		 
         }    	 
    	 
    	 int insert=-1;
    	 
    	 for(int i=0;i<number;i++){
    		 insert=figArray[i];
    		 int j=i-1;
    		 
    		 while(j>=0&&figArray[j]>insert){
    			 figArray[j+1]=figArray[j];
    			 j--;
    			 figArray[j+1]=insert;
    		 }
    		 
    		 
    		 for(int k=0;k<number-1;k++){
    			 System.out.print(figArray[k]+" ");
    		 }
    		 System.out.println(figArray[number-1]);
    		 
    	 }
    }   
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int number = Integer.parseInt(line);
        
        String line2 = sc.nextLine();
        String[] line2sp = new String[number];
    	line2sp=line2.split(" ");
    	int[] figArray = new int[number];
    	int[] afterSort = new int[number];
    	
    	 for(int i=0;i<number;i++){
    		 figArray[i]=Integer.parseInt(line2sp[i]);
    		 afterSort[i]=0;
    		 
         }    	 
    	 
    	 int insert=-1;
    	 
    	 for(int i=0;i<number;i++){
    		 insert=figArray[i];
    		 int j=i-1;
    		 
    		 while(j>=0&&figArray[j]>insert){
    			 figArray[j+1]=figArray[j];
    			 j--;
    			 figArray[j+1]=insert;
    		 }
    		 
    		 
    		 for(int k=0;k<number-1;k++){
    			 System.out.print(figArray[k]+" ");
    		 }
    		 System.out.println(figArray[number-1]);
    		 
    	 }
    } main {
    	Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int number = Integer.parseInt(line);
        
        String line2 = sc.nextLine();
        String[] line2sp = new String[number];
    	line2sp=line2.split(" ");
    	int[] figArray = new int[number];
    	int[] afterSort = new int[number];
    	
    	 for(int i=0;i<number;i++){
    		 figArray[i]=Integer.parseInt(line2sp[i]);
    		 afterSort[i]=0;
    		 
         }    	 
    	 
    	 int insert=-1;
    	 
    	 for(int i=0;i<number;i++){
    		 insert=figArray[i];
    		 int j=i-1;
    		 
    		 while(j>=0&&figArray[j]>insert){
    			 figArray[j+1]=figArray[j];
    			 j--;
    			 figArray[j+1]=insert;
    		 }
    		 
    		 
    		 for(int k=0;k<number-1;k++){
    			 System.out.print(figArray[k]+" ");
    		 }
    		 System.out.println(figArray[number-1]);
    		 
    	 }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc int number = Integer.parseInt(line); number Integer.parseInt(line) Integer.parseInt Integer line String line2 = sc.nextLine(); line2 sc.nextLine() sc.nextLine sc String[] line2sp = new String[number]; line2sp new String[number] number line2sp=line2.split(" ") line2sp line2.split(" ") line2.split line2 " " int[] figArray = new int[number]; figArray new int[number] number int[] afterSort = new int[number]; afterSort new int[number] number for(int i=0;i<number;i++){
    		 figArray[i]=Integer.parseInt(line2sp[i]);
    		 afterSort[i]=0;
    		 
         } int i=0; int i=0; i 0 i<number i number i++ i++ i {
    		 figArray[i]=Integer.parseInt(line2sp[i]);
    		 afterSort[i]=0;
    		 
         } {
    		 figArray[i]=Integer.parseInt(line2sp[i]);
    		 afterSort[i]=0;
    		 
         } figArray[i]=Integer.parseInt(line2sp[i]) figArray[i] figArray i Integer.parseInt(line2sp[i]) Integer.parseInt Integer line2sp[i] line2sp i afterSort[i]=0 afterSort[i] afterSort i 0 int insert=-1; insert -1 1 for(int i=0;i<number;i++){
    		 insert=figArray[i];
    		 int j=i-1;
    		 
    		 while(j>=0&&figArray[j]>insert){
    			 figArray[j+1]=figArray[j];
    			 j--;
    			 figArray[j+1]=insert;
    		 }
    		 
    		 
    		 for(int k=0;k<number-1;k++){
    			 System.out.print(figArray[k]+" ");
    		 }
    		 System.out.println(figArray[number-1]);
    		 
    	 } int i=0; int i=0; i 0 i<number i number i++ i++ i {
    		 insert=figArray[i];
    		 int j=i-1;
    		 
    		 while(j>=0&&figArray[j]>insert){
    			 figArray[j+1]=figArray[j];
    			 j--;
    			 figArray[j+1]=insert;
    		 }
    		 
    		 
    		 for(int k=0;k<number-1;k++){
    			 System.out.print(figArray[k]+" ");
    		 }
    		 System.out.println(figArray[number-1]);
    		 
    	 } {
    		 insert=figArray[i];
    		 int j=i-1;
    		 
    		 while(j>=0&&figArray[j]>insert){
    			 figArray[j+1]=figArray[j];
    			 j--;
    			 figArray[j+1]=insert;
    		 }
    		 
    		 
    		 for(int k=0;k<number-1;k++){
    			 System.out.print(figArray[k]+" ");
    		 }
    		 System.out.println(figArray[number-1]);
    		 
    	 } insert=figArray[i] insert figArray[i] figArray i int j=i-1; j i-1 i 1 while(j>=0&&figArray[j]>insert){
    			 figArray[j+1]=figArray[j];
    			 j--;
    			 figArray[j+1]=insert;
    		 } j>=0&&figArray[j]>insert j>=0 j 0 figArray[j]>insert figArray[j] figArray j insert {
    			 figArray[j+1]=figArray[j];
    			 j--;
    			 figArray[j+1]=insert;
    		 } figArray[j+1]=figArray[j] figArray[j+1] figArray j+1 j 1 figArray[j] figArray j j-- j figArray[j+1]=insert figArray[j+1] figArray j+1 j 1 insert for(int k=0;k<number-1;k++){
    			 System.out.print(figArray[k]+" ");
    		 } int k=0; int k=0; k 0 k<number-1 k number-1 number 1 k++ k++ k {
    			 System.out.print(figArray[k]+" ");
    		 } {
    			 System.out.print(figArray[k]+" ");
    		 } System.out.print(figArray[k]+" ") System.out.print System.out System System.out figArray[k]+" " figArray[k] figArray k " " System.out.println(figArray[number-1]) System.out.println System.out System System.out figArray[number-1] figArray number-1 number 1 String[] args args public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int number = Integer.parseInt(line);
        
        String line2 = sc.nextLine();
        String[] line2sp = new String[number];
    	line2sp=line2.split(" ");
    	int[] figArray = new int[number];
    	int[] afterSort = new int[number];
    	
    	 for(int i=0;i<number;i++){
    		 figArray[i]=Integer.parseInt(line2sp[i]);
    		 afterSort[i]=0;
    		 
         }    	 
    	 
    	 int insert=-1;
    	 
    	 for(int i=0;i<number;i++){
    		 insert=figArray[i];
    		 int j=i-1;
    		 
    		 while(j>=0&&figArray[j]>insert){
    			 figArray[j+1]=figArray[j];
    			 j--;
    			 figArray[j+1]=insert;
    		 }
    		 
    		 
    		 for(int k=0;k<number-1;k++){
    			 System.out.print(figArray[k]+" ");
    		 }
    		 System.out.println(figArray[number-1]);
    		 
    	 }
    }   
} public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int number = Integer.parseInt(line);
        
        String line2 = sc.nextLine();
        String[] line2sp = new String[number];
    	line2sp=line2.split(" ");
    	int[] figArray = new int[number];
    	int[] afterSort = new int[number];
    	
    	 for(int i=0;i<number;i++){
    		 figArray[i]=Integer.parseInt(line2sp[i]);
    		 afterSort[i]=0;
    		 
         }    	 
    	 
    	 int insert=-1;
    	 
    	 for(int i=0;i<number;i++){
    		 insert=figArray[i];
    		 int j=i-1;
    		 
    		 while(j>=0&&figArray[j]>insert){
    			 figArray[j+1]=figArray[j];
    			 j--;
    			 figArray[j+1]=insert;
    		 }
    		 
    		 
    		 for(int k=0;k<number-1;k++){
    			 System.out.print(figArray[k]+" ");
    		 }
    		 System.out.println(figArray[number-1]);
    		 
    	 }
    }   
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int number = Integer.parseInt(line);
        
        String line2 = sc.nextLine();
        String[] line2sp = new String[number];
    	line2sp=line2.split(" ");
    	int[] figArray = new int[number];
    	int[] afterSort = new int[number];
    	
    	 for(int i=0;i<number;i++){
    		 figArray[i]=Integer.parseInt(line2sp[i]);
    		 afterSort[i]=0;
    		 
         }    	 
    	 
    	 int insert=-1;
    	 
    	 for(int i=0;i<number;i++){
    		 insert=figArray[i];
    		 int j=i-1;
    		 
    		 while(j>=0&&figArray[j]>insert){
    			 figArray[j+1]=figArray[j];
    			 j--;
    			 figArray[j+1]=insert;
    		 }
    		 
    		 
    		 for(int k=0;k<number-1;k++){
    			 System.out.print(figArray[k]+" ");
    		 }
    		 System.out.println(figArray[number-1]);
    		 
    	 }
    }   
}