import java.util.Scanner;
class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int length = sc.nextInt();
		int [] array = new int[length];
		
		for (int i = 0; i < length; i++) {
			array[i] = sc.nextInt();
		}
		
		for (int i = 0; i < length; i++) {

			for (int j = 0; j < i; j++) {
				if (array[j] > array[i]) {
					int temp = array[i];
					for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					}
					array[j] = temp;
				}
			}

			for (int j = 0; j < length; j++) {
				System.out.print(array[j]);
				if (j != length - 1) {
					System.out.print(" ");
				}
			}
			System.out.println("");
		}
	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int length = sc.nextInt();
		int [] array = new int[length];
		
		for (int i = 0; i < length; i++) {
			array[i] = sc.nextInt();
		}
		
		for (int i = 0; i < length; i++) {

			for (int j = 0; j < i; j++) {
				if (array[j] > array[i]) {
					int temp = array[i];
					for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					}
					array[j] = temp;
				}
			}

			for (int j = 0; j < length; j++) {
				System.out.print(array[j]);
				if (j != length - 1) {
					System.out.print(" ");
				}
			}
			System.out.println("");
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int length = sc.nextInt();
		int [] array = new int[length];
		
		for (int i = 0; i < length; i++) {
			array[i] = sc.nextInt();
		}
		
		for (int i = 0; i < length; i++) {

			for (int j = 0; j < i; j++) {
				if (array[j] > array[i]) {
					int temp = array[i];
					for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					}
					array[j] = temp;
				}
			}

			for (int j = 0; j < length; j++) {
				System.out.print(array[j]);
				if (j != length - 1) {
					System.out.print(" ");
				}
			}
			System.out.println("");
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int length = sc.nextInt();
		int [] array = new int[length];
		
		for (int i = 0; i < length; i++) {
			array[i] = sc.nextInt();
		}
		
		for (int i = 0; i < length; i++) {

			for (int j = 0; j < i; j++) {
				if (array[j] > array[i]) {
					int temp = array[i];
					for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					}
					array[j] = temp;
				}
			}

			for (int j = 0; j < length; j++) {
				System.out.print(array[j]);
				if (j != length - 1) {
					System.out.print(" ");
				}
			}
			System.out.println("");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int length = sc.nextInt(); length sc.nextInt() sc.nextInt sc int [] array = new int[length]; array new int[length] length for (int i = 0; i < length; i++) {
			array[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
			array[i] = sc.nextInt();
		} {
			array[i] = sc.nextInt();
		} array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc for (int i = 0; i < length; i++) {

			for (int j = 0; j < i; j++) {
				if (array[j] > array[i]) {
					int temp = array[i];
					for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					}
					array[j] = temp;
				}
			}

			for (int j = 0; j < length; j++) {
				System.out.print(array[j]);
				if (j != length - 1) {
					System.out.print(" ");
				}
			}
			System.out.println("");
		} int i = 0; int i = 0; i 0 i < length i length i++ i++ i {

			for (int j = 0; j < i; j++) {
				if (array[j] > array[i]) {
					int temp = array[i];
					for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					}
					array[j] = temp;
				}
			}

			for (int j = 0; j < length; j++) {
				System.out.print(array[j]);
				if (j != length - 1) {
					System.out.print(" ");
				}
			}
			System.out.println("");
		} {

			for (int j = 0; j < i; j++) {
				if (array[j] > array[i]) {
					int temp = array[i];
					for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					}
					array[j] = temp;
				}
			}

			for (int j = 0; j < length; j++) {
				System.out.print(array[j]);
				if (j != length - 1) {
					System.out.print(" ");
				}
			}
			System.out.println("");
		} for (int j = 0; j < i; j++) {
				if (array[j] > array[i]) {
					int temp = array[i];
					for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					}
					array[j] = temp;
				}
			} int j = 0; int j = 0; j 0 j < i j i j++ j++ j {
				if (array[j] > array[i]) {
					int temp = array[i];
					for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					}
					array[j] = temp;
				}
			} {
				if (array[j] > array[i]) {
					int temp = array[i];
					for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					}
					array[j] = temp;
				}
			} if (array[j] > array[i]) {
					int temp = array[i];
					for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					}
					array[j] = temp;
				} array[j] > array[i] array[j] array j array[i] array i {
					int temp = array[i];
					for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					}
					array[j] = temp;
				} int temp = array[i]; temp array[i] array i for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					} int k = i - 1; int k = i - 1; k i - 1 i 1 k >= j k j k-- k-- k {
						array[k + 1] = array[k];
					} {
						array[k + 1] = array[k];
					} array[k + 1] = array[k] array[k + 1] array k + 1 k 1 array[k] array k array[j] = temp array[j] array j temp for (int j = 0; j < length; j++) {
				System.out.print(array[j]);
				if (j != length - 1) {
					System.out.print(" ");
				}
			} int j = 0; int j = 0; j 0 j < length j length j++ j++ j {
				System.out.print(array[j]);
				if (j != length - 1) {
					System.out.print(" ");
				}
			} {
				System.out.print(array[j]);
				if (j != length - 1) {
					System.out.print(" ");
				}
			} System.out.print(array[j]) System.out.print System.out System System.out array[j] array j if (j != length - 1) {
					System.out.print(" ");
				} j != length - 1 j length - 1 length 1 {
					System.out.print(" ");
				} System.out.print(" ") System.out.print System.out System System.out " " System.out.println("") System.out.println System.out System System.out "" String[] args args
import java.util.Scanner;
class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int length = sc.nextInt();
		int [] array = new int[length];
		
		for (int i = 0; i < length; i++) {
			array[i] = sc.nextInt();
		}
		
		for (int i = 0; i < length; i++) {

			for (int j = 0; j < i; j++) {
				if (array[j] > array[i]) {
					int temp = array[i];
					for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					}
					array[j] = temp;
				}
			}

			for (int j = 0; j < length; j++) {
				System.out.print(array[j]);
				if (j != length - 1) {
					System.out.print(" ");
				}
			}
			System.out.println("");
		}
	}
}