import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String len = in.nextLine();
        String n = in.nextLine();
        String[] numbers = n.split(" ");
        int[] nums = new int[Integer.parseInt(len)];
        
        for (int s = 0; s < numbers.length; s++) {
        	nums[s] = Integer.parseInt(numbers[s]);
        }
        
        for (int c = 0; c < nums.length; c++) {
    		System.out.print(nums[c]);
    		if (c < nums.length - 1) {
    			System.out.print(" ");
    		} else {
    			System.out.println();
    		}
    	}
        
        int j = 0;
        for (int i = 1; i < nums.length; i++) {
        	int key = nums[i];
        	j = i - 1;
        	
        	while (j >= 0 && nums[j] > key){
        		nums[j+1] = nums[j];
        		j--;
        	}
        	nums[j+1] = key;
            
        	for (int b = 0; b < nums.length; b++) {
        		System.out.print(nums[b]);
        		if (b < nums.length - 1) {
        			System.out.print(" ");
        		} else {
        			System.out.println();
        		}
        	}
        }
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String len = in.nextLine();
        String n = in.nextLine();
        String[] numbers = n.split(" ");
        int[] nums = new int[Integer.parseInt(len)];
        
        for (int s = 0; s < numbers.length; s++) {
        	nums[s] = Integer.parseInt(numbers[s]);
        }
        
        for (int c = 0; c < nums.length; c++) {
    		System.out.print(nums[c]);
    		if (c < nums.length - 1) {
    			System.out.print(" ");
    		} else {
    			System.out.println();
    		}
    	}
        
        int j = 0;
        for (int i = 1; i < nums.length; i++) {
        	int key = nums[i];
        	j = i - 1;
        	
        	while (j >= 0 && nums[j] > key){
        		nums[j+1] = nums[j];
        		j--;
        	}
        	nums[j+1] = key;
            
        	for (int b = 0; b < nums.length; b++) {
        		System.out.print(nums[b]);
        		if (b < nums.length - 1) {
        			System.out.print(" ");
        		} else {
        			System.out.println();
        		}
        	}
        }
	}
} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String len = in.nextLine();
        String n = in.nextLine();
        String[] numbers = n.split(" ");
        int[] nums = new int[Integer.parseInt(len)];
        
        for (int s = 0; s < numbers.length; s++) {
        	nums[s] = Integer.parseInt(numbers[s]);
        }
        
        for (int c = 0; c < nums.length; c++) {
    		System.out.print(nums[c]);
    		if (c < nums.length - 1) {
    			System.out.print(" ");
    		} else {
    			System.out.println();
    		}
    	}
        
        int j = 0;
        for (int i = 1; i < nums.length; i++) {
        	int key = nums[i];
        	j = i - 1;
        	
        	while (j >= 0 && nums[j] > key){
        		nums[j+1] = nums[j];
        		j--;
        	}
        	nums[j+1] = key;
            
        	for (int b = 0; b < nums.length; b++) {
        		System.out.print(nums[b]);
        		if (b < nums.length - 1) {
        			System.out.print(" ");
        		} else {
        			System.out.println();
        		}
        	}
        }
	} main {
		Scanner in = new Scanner(System.in);
        String len = in.nextLine();
        String n = in.nextLine();
        String[] numbers = n.split(" ");
        int[] nums = new int[Integer.parseInt(len)];
        
        for (int s = 0; s < numbers.length; s++) {
        	nums[s] = Integer.parseInt(numbers[s]);
        }
        
        for (int c = 0; c < nums.length; c++) {
    		System.out.print(nums[c]);
    		if (c < nums.length - 1) {
    			System.out.print(" ");
    		} else {
    			System.out.println();
    		}
    	}
        
        int j = 0;
        for (int i = 1; i < nums.length; i++) {
        	int key = nums[i];
        	j = i - 1;
        	
        	while (j >= 0 && nums[j] > key){
        		nums[j+1] = nums[j];
        		j--;
        	}
        	nums[j+1] = key;
            
        	for (int b = 0; b < nums.length; b++) {
        		System.out.print(nums[b]);
        		if (b < nums.length - 1) {
        			System.out.print(" ");
        		} else {
        			System.out.println();
        		}
        	}
        }
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) String len = in.nextLine(); len in.nextLine() in.nextLine in String n = in.nextLine(); n in.nextLine() in.nextLine in String[] numbers = n.split(" "); numbers n.split(" ") n.split n " " int[] nums = new int[Integer.parseInt(len)]; nums new int[Integer.parseInt(len)] Integer.parseInt(len) Integer.parseInt Integer len for (int s = 0; s < numbers.length; s++) {
        	nums[s] = Integer.parseInt(numbers[s]);
        } int s = 0; int s = 0; s 0 s < numbers.length s numbers.length numbers numbers.length s++ s++ s {
        	nums[s] = Integer.parseInt(numbers[s]);
        } {
        	nums[s] = Integer.parseInt(numbers[s]);
        } nums[s] = Integer.parseInt(numbers[s]) nums[s] nums s Integer.parseInt(numbers[s]) Integer.parseInt Integer numbers[s] numbers s for (int c = 0; c < nums.length; c++) {
    		System.out.print(nums[c]);
    		if (c < nums.length - 1) {
    			System.out.print(" ");
    		} else {
    			System.out.println();
    		}
    	} int c = 0; int c = 0; c 0 c < nums.length c nums.length nums nums.length c++ c++ c {
    		System.out.print(nums[c]);
    		if (c < nums.length - 1) {
    			System.out.print(" ");
    		} else {
    			System.out.println();
    		}
    	} {
    		System.out.print(nums[c]);
    		if (c < nums.length - 1) {
    			System.out.print(" ");
    		} else {
    			System.out.println();
    		}
    	} System.out.print(nums[c]) System.out.print System.out System System.out nums[c] nums c if (c < nums.length - 1) {
    			System.out.print(" ");
    		} else {
    			System.out.println();
    		} c < nums.length - 1 c nums.length - 1 nums.length nums nums.length 1 {
    			System.out.print(" ");
    		} System.out.print(" ") System.out.print System.out System System.out " " {
    			System.out.println();
    		} System.out.println() System.out.println System.out System System.out int j = 0; j 0 for (int i = 1; i < nums.length; i++) {
        	int key = nums[i];
        	j = i - 1;
        	
        	while (j >= 0 && nums[j] > key){
        		nums[j+1] = nums[j];
        		j--;
        	}
        	nums[j+1] = key;
            
        	for (int b = 0; b < nums.length; b++) {
        		System.out.print(nums[b]);
        		if (b < nums.length - 1) {
        			System.out.print(" ");
        		} else {
        			System.out.println();
        		}
        	}
        } int i = 1; int i = 1; i 1 i < nums.length i nums.length nums nums.length i++ i++ i {
        	int key = nums[i];
        	j = i - 1;
        	
        	while (j >= 0 && nums[j] > key){
        		nums[j+1] = nums[j];
        		j--;
        	}
        	nums[j+1] = key;
            
        	for (int b = 0; b < nums.length; b++) {
        		System.out.print(nums[b]);
        		if (b < nums.length - 1) {
        			System.out.print(" ");
        		} else {
        			System.out.println();
        		}
        	}
        } {
        	int key = nums[i];
        	j = i - 1;
        	
        	while (j >= 0 && nums[j] > key){
        		nums[j+1] = nums[j];
        		j--;
        	}
        	nums[j+1] = key;
            
        	for (int b = 0; b < nums.length; b++) {
        		System.out.print(nums[b]);
        		if (b < nums.length - 1) {
        			System.out.print(" ");
        		} else {
        			System.out.println();
        		}
        	}
        } int key = nums[i]; key nums[i] nums i j = i - 1 j i - 1 i 1 while (j >= 0 && nums[j] > key){
        		nums[j+1] = nums[j];
        		j--;
        	} j >= 0 && nums[j] > key j >= 0 j 0 nums[j] > key nums[j] nums j key {
        		nums[j+1] = nums[j];
        		j--;
        	} nums[j+1] = nums[j] nums[j+1] nums j+1 j 1 nums[j] nums j j-- j nums[j+1] = key nums[j+1] nums j+1 j 1 key for (int b = 0; b < nums.length; b++) {
        		System.out.print(nums[b]);
        		if (b < nums.length - 1) {
        			System.out.print(" ");
        		} else {
        			System.out.println();
        		}
        	} int b = 0; int b = 0; b 0 b < nums.length b nums.length nums nums.length b++ b++ b {
        		System.out.print(nums[b]);
        		if (b < nums.length - 1) {
        			System.out.print(" ");
        		} else {
        			System.out.println();
        		}
        	} {
        		System.out.print(nums[b]);
        		if (b < nums.length - 1) {
        			System.out.print(" ");
        		} else {
        			System.out.println();
        		}
        	} System.out.print(nums[b]) System.out.print System.out System System.out nums[b] nums b if (b < nums.length - 1) {
        			System.out.print(" ");
        		} else {
        			System.out.println();
        		} b < nums.length - 1 b nums.length - 1 nums.length nums nums.length 1 {
        			System.out.print(" ");
        		} System.out.print(" ") System.out.print System.out System System.out " " {
        			System.out.println();
        		} System.out.println() System.out.println System.out System System.out String[] args args public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String len = in.nextLine();
        String n = in.nextLine();
        String[] numbers = n.split(" ");
        int[] nums = new int[Integer.parseInt(len)];
        
        for (int s = 0; s < numbers.length; s++) {
        	nums[s] = Integer.parseInt(numbers[s]);
        }
        
        for (int c = 0; c < nums.length; c++) {
    		System.out.print(nums[c]);
    		if (c < nums.length - 1) {
    			System.out.print(" ");
    		} else {
    			System.out.println();
    		}
    	}
        
        int j = 0;
        for (int i = 1; i < nums.length; i++) {
        	int key = nums[i];
        	j = i - 1;
        	
        	while (j >= 0 && nums[j] > key){
        		nums[j+1] = nums[j];
        		j--;
        	}
        	nums[j+1] = key;
            
        	for (int b = 0; b < nums.length; b++) {
        		System.out.print(nums[b]);
        		if (b < nums.length - 1) {
        			System.out.print(" ");
        		} else {
        			System.out.println();
        		}
        	}
        }
	}
} public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String len = in.nextLine();
        String n = in.nextLine();
        String[] numbers = n.split(" ");
        int[] nums = new int[Integer.parseInt(len)];
        
        for (int s = 0; s < numbers.length; s++) {
        	nums[s] = Integer.parseInt(numbers[s]);
        }
        
        for (int c = 0; c < nums.length; c++) {
    		System.out.print(nums[c]);
    		if (c < nums.length - 1) {
    			System.out.print(" ");
    		} else {
    			System.out.println();
    		}
    	}
        
        int j = 0;
        for (int i = 1; i < nums.length; i++) {
        	int key = nums[i];
        	j = i - 1;
        	
        	while (j >= 0 && nums[j] > key){
        		nums[j+1] = nums[j];
        		j--;
        	}
        	nums[j+1] = key;
            
        	for (int b = 0; b < nums.length; b++) {
        		System.out.print(nums[b]);
        		if (b < nums.length - 1) {
        			System.out.print(" ");
        		} else {
        			System.out.println();
        		}
        	}
        }
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String len = in.nextLine();
        String n = in.nextLine();
        String[] numbers = n.split(" ");
        int[] nums = new int[Integer.parseInt(len)];
        
        for (int s = 0; s < numbers.length; s++) {
        	nums[s] = Integer.parseInt(numbers[s]);
        }
        
        for (int c = 0; c < nums.length; c++) {
    		System.out.print(nums[c]);
    		if (c < nums.length - 1) {
    			System.out.print(" ");
    		} else {
    			System.out.println();
    		}
    	}
        
        int j = 0;
        for (int i = 1; i < nums.length; i++) {
        	int key = nums[i];
        	j = i - 1;
        	
        	while (j >= 0 && nums[j] > key){
        		nums[j+1] = nums[j];
        		j--;
        	}
        	nums[j+1] = key;
            
        	for (int b = 0; b < nums.length; b++) {
        		System.out.print(nums[b]);
        		if (b < nums.length - 1) {
        			System.out.print(" ");
        		} else {
        			System.out.println();
        		}
        	}
        }
	}
}
