import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
	//??\??????????????????
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //????????°?????????
        int numberCount = Integer.parseInt(br.readLine());
        //???????????¶????????°??????????????????
        String[] sNumbers = br.readLine().split(" ");
        //????????°?????????????????????
        int[] numbers = new int[numberCount];
        //?????????????????°????????????
        for(int i = 0 ; i < numberCount ; i++){
        	numbers[i] = Integer.parseInt(sNumbers[i]);
        }
        insertionSort(numbers);
	}
	
	private static void insertionSort(int[] numbers){
		displayNumbers(numbers);
		for(int i = 1 ; i < numbers.length ; i++){
			int currentNumber = numbers[i];
			int insertIndex = i;
			for(int y = i - 1 ; y >= 0 ; y--){
				if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				}
			}
			numbers[insertIndex] = currentNumber;
			displayNumbers(numbers);
		}
	}
	
	private static void displayNumbers(int[] numbers){
		StringBuffer sb = new StringBuffer();
		for(int i = 0 ; i < numbers.length ; i++){
			sb.append(numbers[i]);
			sb.append(" ");
		}
		System.out.println(sb.toString().trim());
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws Exception {
	//??\??????????????????
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //????????°?????????
        int numberCount = Integer.parseInt(br.readLine());
        //???????????¶????????°??????????????????
        String[] sNumbers = br.readLine().split(" ");
        //????????°?????????????????????
        int[] numbers = new int[numberCount];
        //?????????????????°????????????
        for(int i = 0 ; i < numberCount ; i++){
        	numbers[i] = Integer.parseInt(sNumbers[i]);
        }
        insertionSort(numbers);
	}
	
	private static void insertionSort(int[] numbers){
		displayNumbers(numbers);
		for(int i = 1 ; i < numbers.length ; i++){
			int currentNumber = numbers[i];
			int insertIndex = i;
			for(int y = i - 1 ; y >= 0 ; y--){
				if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				}
			}
			numbers[insertIndex] = currentNumber;
			displayNumbers(numbers);
		}
	}
	
	private static void displayNumbers(int[] numbers){
		StringBuffer sb = new StringBuffer();
		for(int i = 0 ; i < numbers.length ; i++){
			sb.append(numbers[i]);
			sb.append(" ");
		}
		System.out.println(sb.toString().trim());
	}

} Main public static void main(String[] args) throws Exception {
	//??\??????????????????
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //????????°?????????
        int numberCount = Integer.parseInt(br.readLine());
        //???????????¶????????°??????????????????
        String[] sNumbers = br.readLine().split(" ");
        //????????°?????????????????????
        int[] numbers = new int[numberCount];
        //?????????????????°????????????
        for(int i = 0 ; i < numberCount ; i++){
        	numbers[i] = Integer.parseInt(sNumbers[i]);
        }
        insertionSort(numbers);
	} main {
	//??\??????????????????
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //????????°?????????
        int numberCount = Integer.parseInt(br.readLine());
        //???????????¶????????°??????????????????
        String[] sNumbers = br.readLine().split(" ");
        //????????°?????????????????????
        int[] numbers = new int[numberCount];
        //?????????????????°????????????
        for(int i = 0 ; i < numberCount ; i++){
        	numbers[i] = Integer.parseInt(sNumbers[i]);
        }
        insertionSort(numbers);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int numberCount = Integer.parseInt(br.readLine()); numberCount Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] sNumbers = br.readLine().split(" "); sNumbers br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] numbers = new int[numberCount]; numbers new int[numberCount] numberCount for(int i = 0 ; i < numberCount ; i++){
        	numbers[i] = Integer.parseInt(sNumbers[i]);
        } int i = 0 ; int i = 0 ; i 0 i < numberCount i numberCount i++ i++ i {
        	numbers[i] = Integer.parseInt(sNumbers[i]);
        } {
        	numbers[i] = Integer.parseInt(sNumbers[i]);
        } numbers[i] = Integer.parseInt(sNumbers[i]) numbers[i] numbers i Integer.parseInt(sNumbers[i]) Integer.parseInt Integer sNumbers[i] sNumbers i insertionSort(numbers) insertionSort numbers String[] args args private static void insertionSort(int[] numbers){
		displayNumbers(numbers);
		for(int i = 1 ; i < numbers.length ; i++){
			int currentNumber = numbers[i];
			int insertIndex = i;
			for(int y = i - 1 ; y >= 0 ; y--){
				if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				}
			}
			numbers[insertIndex] = currentNumber;
			displayNumbers(numbers);
		}
	} insertionSort {
		displayNumbers(numbers);
		for(int i = 1 ; i < numbers.length ; i++){
			int currentNumber = numbers[i];
			int insertIndex = i;
			for(int y = i - 1 ; y >= 0 ; y--){
				if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				}
			}
			numbers[insertIndex] = currentNumber;
			displayNumbers(numbers);
		}
	} displayNumbers(numbers) displayNumbers numbers for(int i = 1 ; i < numbers.length ; i++){
			int currentNumber = numbers[i];
			int insertIndex = i;
			for(int y = i - 1 ; y >= 0 ; y--){
				if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				}
			}
			numbers[insertIndex] = currentNumber;
			displayNumbers(numbers);
		} int i = 1 ; int i = 1 ; i 1 i < numbers.length i numbers.length numbers numbers.length i++ i++ i {
			int currentNumber = numbers[i];
			int insertIndex = i;
			for(int y = i - 1 ; y >= 0 ; y--){
				if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				}
			}
			numbers[insertIndex] = currentNumber;
			displayNumbers(numbers);
		} {
			int currentNumber = numbers[i];
			int insertIndex = i;
			for(int y = i - 1 ; y >= 0 ; y--){
				if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				}
			}
			numbers[insertIndex] = currentNumber;
			displayNumbers(numbers);
		} int currentNumber = numbers[i]; currentNumber numbers[i] numbers i int insertIndex = i; insertIndex i for(int y = i - 1 ; y >= 0 ; y--){
				if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				}
			} int y = i - 1 ; int y = i - 1 ; y i - 1 i 1 y >= 0 y 0 y-- y-- y {
				if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				}
			} {
				if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				}
			} if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				} currentNumber < numbers[y] currentNumber numbers[y] numbers y {
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				} numbers[y + 1] = numbers[y] numbers[y + 1] numbers y + 1 y 1 numbers[y] numbers y insertIndex = y insertIndex y {
					break;
				} break; numbers[insertIndex] = currentNumber numbers[insertIndex] numbers insertIndex currentNumber displayNumbers(numbers) displayNumbers numbers int[] numbers numbers private static void displayNumbers(int[] numbers){
		StringBuffer sb = new StringBuffer();
		for(int i = 0 ; i < numbers.length ; i++){
			sb.append(numbers[i]);
			sb.append(" ");
		}
		System.out.println(sb.toString().trim());
	} displayNumbers {
		StringBuffer sb = new StringBuffer();
		for(int i = 0 ; i < numbers.length ; i++){
			sb.append(numbers[i]);
			sb.append(" ");
		}
		System.out.println(sb.toString().trim());
	} StringBuffer sb = new StringBuffer(); sb new StringBuffer() for(int i = 0 ; i < numbers.length ; i++){
			sb.append(numbers[i]);
			sb.append(" ");
		} int i = 0 ; int i = 0 ; i 0 i < numbers.length i numbers.length numbers numbers.length i++ i++ i {
			sb.append(numbers[i]);
			sb.append(" ");
		} {
			sb.append(numbers[i]);
			sb.append(" ");
		} sb.append(numbers[i]) sb.append sb numbers[i] numbers i sb.append(" ") sb.append sb " " System.out.println(sb.toString().trim()) System.out.println System.out System System.out sb.toString().trim() sb.toString().trim sb.toString() sb.toString sb int[] numbers numbers public class Main {

	public static void main(String[] args) throws Exception {
	//??\??????????????????
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //????????°?????????
        int numberCount = Integer.parseInt(br.readLine());
        //???????????¶????????°??????????????????
        String[] sNumbers = br.readLine().split(" ");
        //????????°?????????????????????
        int[] numbers = new int[numberCount];
        //?????????????????°????????????
        for(int i = 0 ; i < numberCount ; i++){
        	numbers[i] = Integer.parseInt(sNumbers[i]);
        }
        insertionSort(numbers);
	}
	
	private static void insertionSort(int[] numbers){
		displayNumbers(numbers);
		for(int i = 1 ; i < numbers.length ; i++){
			int currentNumber = numbers[i];
			int insertIndex = i;
			for(int y = i - 1 ; y >= 0 ; y--){
				if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				}
			}
			numbers[insertIndex] = currentNumber;
			displayNumbers(numbers);
		}
	}
	
	private static void displayNumbers(int[] numbers){
		StringBuffer sb = new StringBuffer();
		for(int i = 0 ; i < numbers.length ; i++){
			sb.append(numbers[i]);
			sb.append(" ");
		}
		System.out.println(sb.toString().trim());
	}

} public class Main {

	public static void main(String[] args) throws Exception {
	//??\??????????????????
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //????????°?????????
        int numberCount = Integer.parseInt(br.readLine());
        //???????????¶????????°??????????????????
        String[] sNumbers = br.readLine().split(" ");
        //????????°?????????????????????
        int[] numbers = new int[numberCount];
        //?????????????????°????????????
        for(int i = 0 ; i < numberCount ; i++){
        	numbers[i] = Integer.parseInt(sNumbers[i]);
        }
        insertionSort(numbers);
	}
	
	private static void insertionSort(int[] numbers){
		displayNumbers(numbers);
		for(int i = 1 ; i < numbers.length ; i++){
			int currentNumber = numbers[i];
			int insertIndex = i;
			for(int y = i - 1 ; y >= 0 ; y--){
				if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				}
			}
			numbers[insertIndex] = currentNumber;
			displayNumbers(numbers);
		}
	}
	
	private static void displayNumbers(int[] numbers){
		StringBuffer sb = new StringBuffer();
		for(int i = 0 ; i < numbers.length ; i++){
			sb.append(numbers[i]);
			sb.append(" ");
		}
		System.out.println(sb.toString().trim());
	}

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
	//??\??????????????????
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //????????°?????????
        int numberCount = Integer.parseInt(br.readLine());
        //???????????¶????????°??????????????????
        String[] sNumbers = br.readLine().split(" ");
        //????????°?????????????????????
        int[] numbers = new int[numberCount];
        //?????????????????°????????????
        for(int i = 0 ; i < numberCount ; i++){
        	numbers[i] = Integer.parseInt(sNumbers[i]);
        }
        insertionSort(numbers);
	}
	
	private static void insertionSort(int[] numbers){
		displayNumbers(numbers);
		for(int i = 1 ; i < numbers.length ; i++){
			int currentNumber = numbers[i];
			int insertIndex = i;
			for(int y = i - 1 ; y >= 0 ; y--){
				if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				}
			}
			numbers[insertIndex] = currentNumber;
			displayNumbers(numbers);
		}
	}
	
	private static void displayNumbers(int[] numbers){
		StringBuffer sb = new StringBuffer();
		for(int i = 0 ; i < numbers.length ; i++){
			sb.append(numbers[i]);
			sb.append(" ");
		}
		System.out.println(sb.toString().trim());
	}

}