import java.text.ParseException;
import java.util.Scanner;

public class Main {

	public static void main(String[] arges) throws ParseException {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] lc = line2.split(" ");
		for (int i = 0; i < vs.length; i++) {
			vs[i] = Integer.parseInt(lc[i]);
		}
		System.out.println(line2);

		for (int i = 1; i < vs.length; i++) {
			int key = vs[i];
			int j = i - 1;
			while (j >= 0 && vs[j] > key) {
				vs[j + 1] = vs[j];
				j--;
			}
			vs[j + 1] = key;
			for (int j2 = 0; j2 < vs.length - 1; j2++) {
				System.out.print(vs[j2] + " ");
				if (j2 == vs.length - 2) {
					System.out.println(vs[j2 + 1]);
				}
			}

		}

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

	public static void main(String[] arges) throws ParseException {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] lc = line2.split(" ");
		for (int i = 0; i < vs.length; i++) {
			vs[i] = Integer.parseInt(lc[i]);
		}
		System.out.println(line2);

		for (int i = 1; i < vs.length; i++) {
			int key = vs[i];
			int j = i - 1;
			while (j >= 0 && vs[j] > key) {
				vs[j + 1] = vs[j];
				j--;
			}
			vs[j + 1] = key;
			for (int j2 = 0; j2 < vs.length - 1; j2++) {
				System.out.print(vs[j2] + " ");
				if (j2 == vs.length - 2) {
					System.out.println(vs[j2 + 1]);
				}
			}

		}

	}
} Main public static void main(String[] arges) throws ParseException {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] lc = line2.split(" ");
		for (int i = 0; i < vs.length; i++) {
			vs[i] = Integer.parseInt(lc[i]);
		}
		System.out.println(line2);

		for (int i = 1; i < vs.length; i++) {
			int key = vs[i];
			int j = i - 1;
			while (j >= 0 && vs[j] > key) {
				vs[j + 1] = vs[j];
				j--;
			}
			vs[j + 1] = key;
			for (int j2 = 0; j2 < vs.length - 1; j2++) {
				System.out.print(vs[j2] + " ");
				if (j2 == vs.length - 2) {
					System.out.println(vs[j2 + 1]);
				}
			}

		}

	} main {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] lc = line2.split(" ");
		for (int i = 0; i < vs.length; i++) {
			vs[i] = Integer.parseInt(lc[i]);
		}
		System.out.println(line2);

		for (int i = 1; i < vs.length; i++) {
			int key = vs[i];
			int j = i - 1;
			while (j >= 0 && vs[j] > key) {
				vs[j + 1] = vs[j];
				j--;
			}
			vs[j + 1] = key;
			for (int j2 = 0; j2 < vs.length - 1; j2++) {
				System.out.print(vs[j2] + " ");
				if (j2 == vs.length - 2) {
					System.out.println(vs[j2 + 1]);
				}
			}

		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc int v = Integer.parseInt(line); v Integer.parseInt(line) Integer.parseInt Integer line int[] vs = new int[v]; vs new int[v] v String line2 = sc.nextLine(); line2 sc.nextLine() sc.nextLine sc String[] lc = line2.split(" "); lc line2.split(" ") line2.split line2 " " for (int i = 0; i < vs.length; i++) {
			vs[i] = Integer.parseInt(lc[i]);
		} int i = 0; int i = 0; i 0 i < vs.length i vs.length vs vs.length i++ i++ i {
			vs[i] = Integer.parseInt(lc[i]);
		} {
			vs[i] = Integer.parseInt(lc[i]);
		} vs[i] = Integer.parseInt(lc[i]) vs[i] vs i Integer.parseInt(lc[i]) Integer.parseInt Integer lc[i] lc i System.out.println(line2) System.out.println System.out System System.out line2 for (int i = 1; i < vs.length; i++) {
			int key = vs[i];
			int j = i - 1;
			while (j >= 0 && vs[j] > key) {
				vs[j + 1] = vs[j];
				j--;
			}
			vs[j + 1] = key;
			for (int j2 = 0; j2 < vs.length - 1; j2++) {
				System.out.print(vs[j2] + " ");
				if (j2 == vs.length - 2) {
					System.out.println(vs[j2 + 1]);
				}
			}

		} int i = 1; int i = 1; i 1 i < vs.length i vs.length vs vs.length i++ i++ i {
			int key = vs[i];
			int j = i - 1;
			while (j >= 0 && vs[j] > key) {
				vs[j + 1] = vs[j];
				j--;
			}
			vs[j + 1] = key;
			for (int j2 = 0; j2 < vs.length - 1; j2++) {
				System.out.print(vs[j2] + " ");
				if (j2 == vs.length - 2) {
					System.out.println(vs[j2 + 1]);
				}
			}

		} {
			int key = vs[i];
			int j = i - 1;
			while (j >= 0 && vs[j] > key) {
				vs[j + 1] = vs[j];
				j--;
			}
			vs[j + 1] = key;
			for (int j2 = 0; j2 < vs.length - 1; j2++) {
				System.out.print(vs[j2] + " ");
				if (j2 == vs.length - 2) {
					System.out.println(vs[j2 + 1]);
				}
			}

		} int key = vs[i]; key vs[i] vs i int j = i - 1; j i - 1 i 1 while (j >= 0 && vs[j] > key) {
				vs[j + 1] = vs[j];
				j--;
			} j >= 0 && vs[j] > key j >= 0 j 0 vs[j] > key vs[j] vs j key {
				vs[j + 1] = vs[j];
				j--;
			} vs[j + 1] = vs[j] vs[j + 1] vs j + 1 j 1 vs[j] vs j j-- j vs[j + 1] = key vs[j + 1] vs j + 1 j 1 key for (int j2 = 0; j2 < vs.length - 1; j2++) {
				System.out.print(vs[j2] + " ");
				if (j2 == vs.length - 2) {
					System.out.println(vs[j2 + 1]);
				}
			} int j2 = 0; int j2 = 0; j2 0 j2 < vs.length - 1 j2 vs.length - 1 vs.length vs vs.length 1 j2++ j2++ j2 {
				System.out.print(vs[j2] + " ");
				if (j2 == vs.length - 2) {
					System.out.println(vs[j2 + 1]);
				}
			} {
				System.out.print(vs[j2] + " ");
				if (j2 == vs.length - 2) {
					System.out.println(vs[j2 + 1]);
				}
			} System.out.print(vs[j2] + " ") System.out.print System.out System System.out vs[j2] + " " vs[j2] vs j2 " " if (j2 == vs.length - 2) {
					System.out.println(vs[j2 + 1]);
				} j2 == vs.length - 2 j2 vs.length - 2 vs.length vs vs.length 2 {
					System.out.println(vs[j2 + 1]);
				} System.out.println(vs[j2 + 1]) System.out.println System.out System System.out vs[j2 + 1] vs j2 + 1 j2 1 String[] arges arges public class Main {

	public static void main(String[] arges) throws ParseException {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] lc = line2.split(" ");
		for (int i = 0; i < vs.length; i++) {
			vs[i] = Integer.parseInt(lc[i]);
		}
		System.out.println(line2);

		for (int i = 1; i < vs.length; i++) {
			int key = vs[i];
			int j = i - 1;
			while (j >= 0 && vs[j] > key) {
				vs[j + 1] = vs[j];
				j--;
			}
			vs[j + 1] = key;
			for (int j2 = 0; j2 < vs.length - 1; j2++) {
				System.out.print(vs[j2] + " ");
				if (j2 == vs.length - 2) {
					System.out.println(vs[j2 + 1]);
				}
			}

		}

	}
} public class Main {

	public static void main(String[] arges) throws ParseException {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] lc = line2.split(" ");
		for (int i = 0; i < vs.length; i++) {
			vs[i] = Integer.parseInt(lc[i]);
		}
		System.out.println(line2);

		for (int i = 1; i < vs.length; i++) {
			int key = vs[i];
			int j = i - 1;
			while (j >= 0 && vs[j] > key) {
				vs[j + 1] = vs[j];
				j--;
			}
			vs[j + 1] = key;
			for (int j2 = 0; j2 < vs.length - 1; j2++) {
				System.out.print(vs[j2] + " ");
				if (j2 == vs.length - 2) {
					System.out.println(vs[j2 + 1]);
				}
			}

		}

	}
} Main
import java.text.ParseException;
import java.util.Scanner;

public class Main {

	public static void main(String[] arges) throws ParseException {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int[] vs = new int[v];
		String line2 = sc.nextLine();
		String[] lc = line2.split(" ");
		for (int i = 0; i < vs.length; i++) {
			vs[i] = Integer.parseInt(lc[i]);
		}
		System.out.println(line2);

		for (int i = 1; i < vs.length; i++) {
			int key = vs[i];
			int j = i - 1;
			while (j >= 0 && vs[j] > key) {
				vs[j + 1] = vs[j];
				j--;
			}
			vs[j + 1] = key;
			for (int j2 = 0; j2 < vs.length - 1; j2++) {
				System.out.print(vs[j2] + " ");
				if (j2 == vs.length - 2) {
					System.out.println(vs[j2 + 1]);
				}
			}

		}

	}
}