import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		solve();
	}

	private static void solve() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];

		for (int i = 0; i < n; i++) {
			nums[i] = sc.nextInt();
		}
		sc.close();

		int v;
		int j;
		printArray(nums);

		for (int i = 1; i < n; i++) {
			v = nums[i];
			j = i - 1;
			while (j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
				nums[j + 1] = v;
			}
			printArray(nums);
		}
	}

	private static void printArray(int[] array) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < array.length; i++) {
			sb.append(array[i]);
			if (i != array.length - 1) {
				sb.append(" ");
			}
		}
		System.out.println(sb.toString());
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		solve();
	}

	private static void solve() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];

		for (int i = 0; i < n; i++) {
			nums[i] = sc.nextInt();
		}
		sc.close();

		int v;
		int j;
		printArray(nums);

		for (int i = 1; i < n; i++) {
			v = nums[i];
			j = i - 1;
			while (j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
				nums[j + 1] = v;
			}
			printArray(nums);
		}
	}

	private static void printArray(int[] array) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < array.length; i++) {
			sb.append(array[i]);
			if (i != array.length - 1) {
				sb.append(" ");
			}
		}
		System.out.println(sb.toString());
	}
} Main public static void main(String[] args) {
		solve();
	} main {
		solve();
	} solve() solve String[] args args private static void solve() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];

		for (int i = 0; i < n; i++) {
			nums[i] = sc.nextInt();
		}
		sc.close();

		int v;
		int j;
		printArray(nums);

		for (int i = 1; i < n; i++) {
			v = nums[i];
			j = i - 1;
			while (j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
				nums[j + 1] = v;
			}
			printArray(nums);
		}
	} solve {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];

		for (int i = 0; i < n; i++) {
			nums[i] = sc.nextInt();
		}
		sc.close();

		int v;
		int j;
		printArray(nums);

		for (int i = 1; i < n; i++) {
			v = nums[i];
			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 i = 0; i < n; i++) {
			nums[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			nums[i] = sc.nextInt();
		} {
			nums[i] = sc.nextInt();
		} nums[i] = sc.nextInt() nums[i] nums i sc.nextInt() sc.nextInt sc sc.close() sc.close sc int v; v int j; j printArray(nums) printArray nums for (int i = 1; i < n; i++) {
			v = nums[i];
			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 i n i++ i++ i {
			v = nums[i];
			j = i - 1;
			while (j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
				nums[j + 1] = v;
			}
			printArray(nums);
		} {
			v = nums[i];
			j = i - 1;
			while (j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
				nums[j + 1] = v;
			}
			printArray(nums);
		} v = nums[i] v nums[i] nums i j = i - 1 j i - 1 i 1 while (j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
				nums[j + 1] = v;
			} 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] = v;
			} 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 private static void printArray(int[] array) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < array.length; i++) {
			sb.append(array[i]);
			if (i != array.length - 1) {
				sb.append(" ");
			}
		}
		System.out.println(sb.toString());
	} printArray {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < array.length; i++) {
			sb.append(array[i]);
			if (i != array.length - 1) {
				sb.append(" ");
			}
		}
		System.out.println(sb.toString());
	} StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int i = 0; i < array.length; i++) {
			sb.append(array[i]);
			if (i != array.length - 1) {
				sb.append(" ");
			}
		} int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i++ i++ i {
			sb.append(array[i]);
			if (i != array.length - 1) {
				sb.append(" ");
			}
		} {
			sb.append(array[i]);
			if (i != array.length - 1) {
				sb.append(" ");
			}
		} sb.append(array[i]) sb.append sb array[i] array i if (i != array.length - 1) {
				sb.append(" ");
			} i != array.length - 1 i array.length - 1 array.length array array.length 1 {
				sb.append(" ");
			} sb.append(" ") sb.append sb " " System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb int[] array array public class Main {
	public static void main(String[] args) {
		solve();
	}

	private static void solve() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];

		for (int i = 0; i < n; i++) {
			nums[i] = sc.nextInt();
		}
		sc.close();

		int v;
		int j;
		printArray(nums);

		for (int i = 1; i < n; i++) {
			v = nums[i];
			j = i - 1;
			while (j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
				nums[j + 1] = v;
			}
			printArray(nums);
		}
	}

	private static void printArray(int[] array) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < array.length; i++) {
			sb.append(array[i]);
			if (i != array.length - 1) {
				sb.append(" ");
			}
		}
		System.out.println(sb.toString());
	}
} public class Main {
	public static void main(String[] args) {
		solve();
	}

	private static void solve() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];

		for (int i = 0; i < n; i++) {
			nums[i] = sc.nextInt();
		}
		sc.close();

		int v;
		int j;
		printArray(nums);

		for (int i = 1; i < n; i++) {
			v = nums[i];
			j = i - 1;
			while (j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
				nums[j + 1] = v;
			}
			printArray(nums);
		}
	}

	private static void printArray(int[] array) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < array.length; i++) {
			sb.append(array[i]);
			if (i != array.length - 1) {
				sb.append(" ");
			}
		}
		System.out.println(sb.toString());
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		solve();
	}

	private static void solve() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];

		for (int i = 0; i < n; i++) {
			nums[i] = sc.nextInt();
		}
		sc.close();

		int v;
		int j;
		printArray(nums);

		for (int i = 1; i < n; i++) {
			v = nums[i];
			j = i - 1;
			while (j >= 0 && nums[j] > v) {
				nums[j + 1] = nums[j];
				j--;
				nums[j + 1] = v;
			}
			printArray(nums);
		}
	}

	private static void printArray(int[] array) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < array.length; i++) {
			sb.append(array[i]);
			if (i != array.length - 1) {
				sb.append(" ");
			}
		}
		System.out.println(sb.toString());
	}
}