import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		printArray(nums);
		for(int i = 1; i <= n - 1; i++) {
			int v = nums[i];
			int j = i - 1;
			while(j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
			}
			nums[j + 1] = v;
			printArray(nums);
		}
	}
	public static void printArray(int[] array) {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		printArray(nums);
		for(int i = 1; i <= n - 1; i++) {
			int v = nums[i];
			int j = i - 1;
			while(j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
			}
			nums[j + 1] = v;
			printArray(nums);
		}
	}
	public static void printArray(int[] array) {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		printArray(nums);
		for(int i = 1; i <= n - 1; i++) {
			int v = nums[i];
			int j = i - 1;
			while(j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
			}
			nums[j + 1] = v;
			printArray(nums);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		printArray(nums);
		for(int i = 1; i <= n - 1; i++) {
			int v = nums[i];
			int j = i - 1;
			while(j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
			}
			nums[j + 1] = v;
			printArray(nums);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] nums = new int[n]; nums new int[n] n for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		} int arrayIndex = 0; int arrayIndex = 0; arrayIndex 0 arrayIndex < n arrayIndex n arrayIndex++ arrayIndex++ arrayIndex {
			nums[arrayIndex] = sc.nextInt();
		} {
			nums[arrayIndex] = sc.nextInt();
		} nums[arrayIndex] = sc.nextInt() nums[arrayIndex] nums arrayIndex sc.nextInt() sc.nextInt sc printArray(nums) printArray nums for(int i = 1; i <= n - 1; i++) {
			int v = nums[i];
			int j = i - 1;
			while(j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
			}
			nums[j + 1] = v;
			printArray(nums);
		} int i = 1; int i = 1; i 1 i <= n - 1 i n - 1 n 1 i++ i++ i {
			int v = nums[i];
			int j = i - 1;
			while(j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
			}
			nums[j + 1] = v;
			printArray(nums);
		} {
			int v = nums[i];
			int j = i - 1;
			while(j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
			}
			nums[j + 1] = v;
			printArray(nums);
		} int v = nums[i]; v nums[i] nums i int j = i - 1; j i - 1 i 1 while(j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
			} j >= 0 && nums[j] > v j >= 0 j 0 nums[j] > v nums[j] nums j v {
				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] = v nums[j + 1] nums j + 1 j 1 v printArray(nums) printArray nums String[] args args public static void printArray(int[] array) {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	} printArray {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	} int arrayLength = array.length; arrayLength array.length array array.length for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		} int index = 0; int index = 0; index 0 index < arrayLength - 1 index arrayLength - 1 arrayLength 1 index++ index++ index {
			System.out.print(array[index] + " ");
		} {
			System.out.print(array[index] + " ");
		} System.out.print(array[index] + " ") System.out.print System.out System System.out array[index] + " " array[index] array index " " System.out.println(array[arrayLength - 1]) System.out.println System.out System System.out array[arrayLength - 1] array arrayLength - 1 arrayLength 1 int[] array array public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		printArray(nums);
		for(int i = 1; i <= n - 1; i++) {
			int v = nums[i];
			int j = i - 1;
			while(j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
			}
			nums[j + 1] = v;
			printArray(nums);
		}
	}
	public static void printArray(int[] array) {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		printArray(nums);
		for(int i = 1; i <= n - 1; i++) {
			int v = nums[i];
			int j = i - 1;
			while(j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
			}
			nums[j + 1] = v;
			printArray(nums);
		}
	}
	public static void printArray(int[] array) {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int arrayIndex = 0; arrayIndex < n; arrayIndex++) {
			nums[arrayIndex] = sc.nextInt();
		}
		printArray(nums);
		for(int i = 1; i <= n - 1; i++) {
			int v = nums[i];
			int j = i - 1;
			while(j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
			}
			nums[j + 1] = v;
			printArray(nums);
		}
	}
	public static void printArray(int[] array) {
		int arrayLength = array.length;
		for(int index = 0; index < arrayLength - 1; index++) {
			System.out.print(array[index] + " ");
		}
		System.out.println(array[arrayLength - 1]);
	}
}