import java.util.Arrays;
import java.util.Scanner;

class Main{
    public static void main(String[] a){
    	Scanner scanner = new Scanner(System.in);
    	
    	int length = Integer.parseInt(scanner.nextLine());
    	String numbers = scanner.nextLine();
    	String[] numberArray = numbers.split(" ",0); 
    	String sortValue;
		System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]",""));
		
    	for (int i = 1;i < length; i++) {
    		sortValue = numberArray[i];
    		for (int j = 0; j <= i - 1; j++) {
    			if (Integer.parseInt(sortValue) < Integer.parseInt(numberArray[j])) {
    				for (int k = 0; k <= i-j-1; k++) {
        				numberArray[i-k] = numberArray[i-k-1];
    				}
    				numberArray[j] = sortValue;
    		    break;
    			}
    		}
			System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]",""));
    		
    	}
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] a){
    	Scanner scanner = new Scanner(System.in);
    	
    	int length = Integer.parseInt(scanner.nextLine());
    	String numbers = scanner.nextLine();
    	String[] numberArray = numbers.split(" ",0); 
    	String sortValue;
		System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]",""));
		
    	for (int i = 1;i < length; i++) {
    		sortValue = numberArray[i];
    		for (int j = 0; j <= i - 1; j++) {
    			if (Integer.parseInt(sortValue) < Integer.parseInt(numberArray[j])) {
    				for (int k = 0; k <= i-j-1; k++) {
        				numberArray[i-k] = numberArray[i-k-1];
    				}
    				numberArray[j] = sortValue;
    		    break;
    			}
    		}
			System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]",""));
    		
    	}
    }
} Main public static void main(String[] a){
    	Scanner scanner = new Scanner(System.in);
    	
    	int length = Integer.parseInt(scanner.nextLine());
    	String numbers = scanner.nextLine();
    	String[] numberArray = numbers.split(" ",0); 
    	String sortValue;
		System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]",""));
		
    	for (int i = 1;i < length; i++) {
    		sortValue = numberArray[i];
    		for (int j = 0; j <= i - 1; j++) {
    			if (Integer.parseInt(sortValue) < Integer.parseInt(numberArray[j])) {
    				for (int k = 0; k <= i-j-1; k++) {
        				numberArray[i-k] = numberArray[i-k-1];
    				}
    				numberArray[j] = sortValue;
    		    break;
    			}
    		}
			System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]",""));
    		
    	}
    } main {
    	Scanner scanner = new Scanner(System.in);
    	
    	int length = Integer.parseInt(scanner.nextLine());
    	String numbers = scanner.nextLine();
    	String[] numberArray = numbers.split(" ",0); 
    	String sortValue;
		System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]",""));
		
    	for (int i = 1;i < length; i++) {
    		sortValue = numberArray[i];
    		for (int j = 0; j <= i - 1; j++) {
    			if (Integer.parseInt(sortValue) < Integer.parseInt(numberArray[j])) {
    				for (int k = 0; k <= i-j-1; k++) {
        				numberArray[i-k] = numberArray[i-k-1];
    				}
    				numberArray[j] = sortValue;
    		    break;
    			}
    		}
			System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]",""));
    		
    	}
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int length = Integer.parseInt(scanner.nextLine()); length Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner String numbers = scanner.nextLine(); numbers scanner.nextLine() scanner.nextLine scanner String[] numberArray = numbers.split(" ",0); numberArray numbers.split(" ",0) numbers.split numbers " " 0 String sortValue; sortValue System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]","")) System.out.println System.out System System.out Arrays.toString(numberArray).replace(",","").replace("[","").replace("]","") Arrays.toString(numberArray).replace(",","").replace("[","").replace Arrays.toString(numberArray).replace(",","").replace("[","") Arrays.toString(numberArray).replace(",","").replace Arrays.toString(numberArray).replace(",","") Arrays.toString(numberArray).replace Arrays.toString(numberArray) Arrays.toString Arrays numberArray "," "" "[" "" "]" "" for (int i = 1;i < length; i++) {
    		sortValue = numberArray[i];
    		for (int j = 0; j <= i - 1; j++) {
    			if (Integer.parseInt(sortValue) < Integer.parseInt(numberArray[j])) {
    				for (int k = 0; k <= i-j-1; k++) {
        				numberArray[i-k] = numberArray[i-k-1];
    				}
    				numberArray[j] = sortValue;
    		    break;
    			}
    		}
			System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]",""));
    		
    	} int i = 1; int i = 1; i 1 i < length i length i++ i++ i {
    		sortValue = numberArray[i];
    		for (int j = 0; j <= i - 1; j++) {
    			if (Integer.parseInt(sortValue) < Integer.parseInt(numberArray[j])) {
    				for (int k = 0; k <= i-j-1; k++) {
        				numberArray[i-k] = numberArray[i-k-1];
    				}
    				numberArray[j] = sortValue;
    		    break;
    			}
    		}
			System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]",""));
    		
    	} {
    		sortValue = numberArray[i];
    		for (int j = 0; j <= i - 1; j++) {
    			if (Integer.parseInt(sortValue) < Integer.parseInt(numberArray[j])) {
    				for (int k = 0; k <= i-j-1; k++) {
        				numberArray[i-k] = numberArray[i-k-1];
    				}
    				numberArray[j] = sortValue;
    		    break;
    			}
    		}
			System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]",""));
    		
    	} sortValue = numberArray[i] sortValue numberArray[i] numberArray i for (int j = 0; j <= i - 1; j++) {
    			if (Integer.parseInt(sortValue) < Integer.parseInt(numberArray[j])) {
    				for (int k = 0; k <= i-j-1; k++) {
        				numberArray[i-k] = numberArray[i-k-1];
    				}
    				numberArray[j] = sortValue;
    		    break;
    			}
    		} int j = 0; int j = 0; j 0 j <= i - 1 j i - 1 i 1 j++ j++ j {
    			if (Integer.parseInt(sortValue) < Integer.parseInt(numberArray[j])) {
    				for (int k = 0; k <= i-j-1; k++) {
        				numberArray[i-k] = numberArray[i-k-1];
    				}
    				numberArray[j] = sortValue;
    		    break;
    			}
    		} {
    			if (Integer.parseInt(sortValue) < Integer.parseInt(numberArray[j])) {
    				for (int k = 0; k <= i-j-1; k++) {
        				numberArray[i-k] = numberArray[i-k-1];
    				}
    				numberArray[j] = sortValue;
    		    break;
    			}
    		} if (Integer.parseInt(sortValue) < Integer.parseInt(numberArray[j])) {
    				for (int k = 0; k <= i-j-1; k++) {
        				numberArray[i-k] = numberArray[i-k-1];
    				}
    				numberArray[j] = sortValue;
    		    break;
    			} Integer.parseInt(sortValue) < Integer.parseInt(numberArray[j]) Integer.parseInt(sortValue) Integer.parseInt Integer sortValue Integer.parseInt(numberArray[j]) Integer.parseInt Integer numberArray[j] numberArray j {
    				for (int k = 0; k <= i-j-1; k++) {
        				numberArray[i-k] = numberArray[i-k-1];
    				}
    				numberArray[j] = sortValue;
    		    break;
    			} for (int k = 0; k <= i-j-1; k++) {
        				numberArray[i-k] = numberArray[i-k-1];
    				} int k = 0; int k = 0; k 0 k <= i-j-1 k i-j-1 i-j-1 i j 1 k++ k++ k {
        				numberArray[i-k] = numberArray[i-k-1];
    				} {
        				numberArray[i-k] = numberArray[i-k-1];
    				} numberArray[i-k] = numberArray[i-k-1] numberArray[i-k] numberArray i-k i k numberArray[i-k-1] numberArray i-k-1 i-k-1 i k 1 numberArray[j] = sortValue numberArray[j] numberArray j sortValue break; System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]","")) System.out.println System.out System System.out Arrays.toString(numberArray).replace(",","").replace("[","").replace("]","") Arrays.toString(numberArray).replace(",","").replace("[","").replace Arrays.toString(numberArray).replace(",","").replace("[","") Arrays.toString(numberArray).replace(",","").replace Arrays.toString(numberArray).replace(",","") Arrays.toString(numberArray).replace Arrays.toString(numberArray) Arrays.toString Arrays numberArray "," "" "[" "" "]" "" String[] a a
import java.util.Arrays;
import java.util.Scanner;

class Main{
    public static void main(String[] a){
    	Scanner scanner = new Scanner(System.in);
    	
    	int length = Integer.parseInt(scanner.nextLine());
    	String numbers = scanner.nextLine();
    	String[] numberArray = numbers.split(" ",0); 
    	String sortValue;
		System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]",""));
		
    	for (int i = 1;i < length; i++) {
    		sortValue = numberArray[i];
    		for (int j = 0; j <= i - 1; j++) {
    			if (Integer.parseInt(sortValue) < Integer.parseInt(numberArray[j])) {
    				for (int k = 0; k <= i-j-1; k++) {
        				numberArray[i-k] = numberArray[i-k-1];
    				}
    				numberArray[j] = sortValue;
    		    break;
    			}
    		}
			System.out.println(Arrays.toString(numberArray).replace(",","").replace("[","").replace("]",""));
    		
    	}
    }
}