
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt();
		int[] array = new int[length];
		for (int i=0; i<length; i++) {
			array[i] = scanner.nextInt();
		}
		scanner.close();
		printArray(array);
		insertionSort(array, length);
		
		
	}
	
	public static void insertionSort(int[] array, int length) {
		for (int i=1; i<length; i++) {
			int key = array[i];
			int j = i - 1;
			while (j>=0 && key<array[j]) {
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = key;
			
			printArray(array);
		}
	}
	
	public static void printArray(int[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i>0) System.out.print(" ");
			System.out.print(array[i]);
		}
		System.out.print("\n");
	}

}
 import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt();
		int[] array = new int[length];
		for (int i=0; i<length; i++) {
			array[i] = scanner.nextInt();
		}
		scanner.close();
		printArray(array);
		insertionSort(array, length);
		
		
	}
	
	public static void insertionSort(int[] array, int length) {
		for (int i=1; i<length; i++) {
			int key = array[i];
			int j = i - 1;
			while (j>=0 && key<array[j]) {
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = key;
			
			printArray(array);
		}
	}
	
	public static void printArray(int[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i>0) System.out.print(" ");
			System.out.print(array[i]);
		}
		System.out.print("\n");
	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt();
		int[] array = new int[length];
		for (int i=0; i<length; i++) {
			array[i] = scanner.nextInt();
		}
		scanner.close();
		printArray(array);
		insertionSort(array, length);
		
		
	} main {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt();
		int[] array = new int[length];
		for (int i=0; i<length; i++) {
			array[i] = scanner.nextInt();
		}
		scanner.close();
		printArray(array);
		insertionSort(array, length);
		
		
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int length = scanner.nextInt(); length scanner.nextInt() scanner.nextInt scanner int[] array = new int[length]; array new int[length] length for (int i=0; i<length; i++) {
			array[i] = scanner.nextInt();
		} int i=0; int i=0; i 0 i<length i length i++ i++ i {
			array[i] = scanner.nextInt();
		} {
			array[i] = scanner.nextInt();
		} array[i] = scanner.nextInt() array[i] array i scanner.nextInt() scanner.nextInt scanner scanner.close() scanner.close scanner printArray(array) printArray array insertionSort(array, length) insertionSort array length String[] args args public static void insertionSort(int[] array, int length) {
		for (int i=1; i<length; i++) {
			int key = array[i];
			int j = i - 1;
			while (j>=0 && key<array[j]) {
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = key;
			
			printArray(array);
		}
	} insertionSort {
		for (int i=1; i<length; i++) {
			int key = array[i];
			int j = i - 1;
			while (j>=0 && key<array[j]) {
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = key;
			
			printArray(array);
		}
	} for (int i=1; i<length; i++) {
			int key = array[i];
			int j = i - 1;
			while (j>=0 && key<array[j]) {
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = key;
			
			printArray(array);
		} int i=1; int i=1; i 1 i<length i length i++ i++ i {
			int key = array[i];
			int j = i - 1;
			while (j>=0 && key<array[j]) {
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = key;
			
			printArray(array);
		} {
			int key = array[i];
			int j = i - 1;
			while (j>=0 && key<array[j]) {
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = key;
			
			printArray(array);
		} int key = array[i]; key array[i] array i int j = i - 1; j i - 1 i 1 while (j>=0 && key<array[j]) {
				array[j+1] = array[j];
				j--;
			} j>=0 && key<array[j] j>=0 j 0 key<array[j] key array[j] array j {
				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] = key array[j+1] array j+1 j 1 key printArray(array) printArray array int[] array array int length length public static void printArray(int[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i>0) System.out.print(" ");
			System.out.print(array[i]);
		}
		System.out.print("\n");
	} printArray {
		for (int i = 0; i < array.length; i++) {
			if (i>0) System.out.print(" ");
			System.out.print(array[i]);
		}
		System.out.print("\n");
	} for (int i = 0; i < array.length; i++) {
			if (i>0) System.out.print(" ");
			System.out.print(array[i]);
		} int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i++ i++ i {
			if (i>0) System.out.print(" ");
			System.out.print(array[i]);
		} {
			if (i>0) System.out.print(" ");
			System.out.print(array[i]);
		} if (i>0) System.out.print(" "); i>0 i 0 System.out.print(" ") System.out.print System.out System System.out " " System.out.print(array[i]) System.out.print System.out System System.out array[i] array i System.out.print("\n") System.out.print System.out System System.out "\n" int[] array array public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt();
		int[] array = new int[length];
		for (int i=0; i<length; i++) {
			array[i] = scanner.nextInt();
		}
		scanner.close();
		printArray(array);
		insertionSort(array, length);
		
		
	}
	
	public static void insertionSort(int[] array, int length) {
		for (int i=1; i<length; i++) {
			int key = array[i];
			int j = i - 1;
			while (j>=0 && key<array[j]) {
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = key;
			
			printArray(array);
		}
	}
	
	public static void printArray(int[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i>0) System.out.print(" ");
			System.out.print(array[i]);
		}
		System.out.print("\n");
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt();
		int[] array = new int[length];
		for (int i=0; i<length; i++) {
			array[i] = scanner.nextInt();
		}
		scanner.close();
		printArray(array);
		insertionSort(array, length);
		
		
	}
	
	public static void insertionSort(int[] array, int length) {
		for (int i=1; i<length; i++) {
			int key = array[i];
			int j = i - 1;
			while (j>=0 && key<array[j]) {
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = key;
			
			printArray(array);
		}
	}
	
	public static void printArray(int[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i>0) System.out.print(" ");
			System.out.print(array[i]);
		}
		System.out.print("\n");
	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt();
		int[] array = new int[length];
		for (int i=0; i<length; i++) {
			array[i] = scanner.nextInt();
		}
		scanner.close();
		printArray(array);
		insertionSort(array, length);
		
		
	}
	
	public static void insertionSort(int[] array, int length) {
		for (int i=1; i<length; i++) {
			int key = array[i];
			int j = i - 1;
			while (j>=0 && key<array[j]) {
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = key;
			
			printArray(array);
		}
	}
	
	public static void printArray(int[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i>0) System.out.print(" ");
			System.out.print(array[i]);
		}
		System.out.print("\n");
	}

}

