import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int[] data = new int[N];
		for (int i = 0; i < N; i++) {
			data[i] = scn.nextInt();
		}
		show(data);
		for (int j = 1; j < N; j++) {
			int v = data[j];
			int w = j - 1;
			while (w >= 0 && data[w] > v) {
				data[w + 1] = data[w];
				w--;
			}
			data[w + 1] = v;
			show(data);
		}

	}

	static void show(int[] pdata) {
		StringBuffer stb = new StringBuffer();
		stb.append(pdata[0]);
		for (int a = 1; a < pdata.length; a++) {
			stb.append(" " + pdata[a]);
		}
		System.out.println(stb.toString());
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int[] data = new int[N];
		for (int i = 0; i < N; i++) {
			data[i] = scn.nextInt();
		}
		show(data);
		for (int j = 1; j < N; j++) {
			int v = data[j];
			int w = j - 1;
			while (w >= 0 && data[w] > v) {
				data[w + 1] = data[w];
				w--;
			}
			data[w + 1] = v;
			show(data);
		}

	}

	static void show(int[] pdata) {
		StringBuffer stb = new StringBuffer();
		stb.append(pdata[0]);
		for (int a = 1; a < pdata.length; a++) {
			stb.append(" " + pdata[a]);
		}
		System.out.println(stb.toString());
	}
} Main public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int[] data = new int[N];
		for (int i = 0; i < N; i++) {
			data[i] = scn.nextInt();
		}
		show(data);
		for (int j = 1; j < N; j++) {
			int v = data[j];
			int w = j - 1;
			while (w >= 0 && data[w] > v) {
				data[w + 1] = data[w];
				w--;
			}
			data[w + 1] = v;
			show(data);
		}

	} main {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int[] data = new int[N];
		for (int i = 0; i < N; i++) {
			data[i] = scn.nextInt();
		}
		show(data);
		for (int j = 1; j < N; j++) {
			int v = data[j];
			int w = j - 1;
			while (w >= 0 && data[w] > v) {
				data[w + 1] = data[w];
				w--;
			}
			data[w + 1] = v;
			show(data);
		}

	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int N = scn.nextInt(); N scn.nextInt() scn.nextInt scn int[] data = new int[N]; data new int[N] N for (int i = 0; i < N; i++) {
			data[i] = scn.nextInt();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			data[i] = scn.nextInt();
		} {
			data[i] = scn.nextInt();
		} data[i] = scn.nextInt() data[i] data i scn.nextInt() scn.nextInt scn show(data) show data for (int j = 1; j < N; j++) {
			int v = data[j];
			int w = j - 1;
			while (w >= 0 && data[w] > v) {
				data[w + 1] = data[w];
				w--;
			}
			data[w + 1] = v;
			show(data);
		} int j = 1; int j = 1; j 1 j < N j N j++ j++ j {
			int v = data[j];
			int w = j - 1;
			while (w >= 0 && data[w] > v) {
				data[w + 1] = data[w];
				w--;
			}
			data[w + 1] = v;
			show(data);
		} {
			int v = data[j];
			int w = j - 1;
			while (w >= 0 && data[w] > v) {
				data[w + 1] = data[w];
				w--;
			}
			data[w + 1] = v;
			show(data);
		} int v = data[j]; v data[j] data j int w = j - 1; w j - 1 j 1 while (w >= 0 && data[w] > v) {
				data[w + 1] = data[w];
				w--;
			} w >= 0 && data[w] > v w >= 0 w 0 data[w] > v data[w] data w v {
				data[w + 1] = data[w];
				w--;
			} data[w + 1] = data[w] data[w + 1] data w + 1 w 1 data[w] data w w-- w data[w + 1] = v data[w + 1] data w + 1 w 1 v show(data) show data String[] args args static void show(int[] pdata) {
		StringBuffer stb = new StringBuffer();
		stb.append(pdata[0]);
		for (int a = 1; a < pdata.length; a++) {
			stb.append(" " + pdata[a]);
		}
		System.out.println(stb.toString());
	} show {
		StringBuffer stb = new StringBuffer();
		stb.append(pdata[0]);
		for (int a = 1; a < pdata.length; a++) {
			stb.append(" " + pdata[a]);
		}
		System.out.println(stb.toString());
	} StringBuffer stb = new StringBuffer(); stb new StringBuffer() stb.append(pdata[0]) stb.append stb pdata[0] pdata 0 for (int a = 1; a < pdata.length; a++) {
			stb.append(" " + pdata[a]);
		} int a = 1; int a = 1; a 1 a < pdata.length a pdata.length pdata pdata.length a++ a++ a {
			stb.append(" " + pdata[a]);
		} {
			stb.append(" " + pdata[a]);
		} stb.append(" " + pdata[a]) stb.append stb " " + pdata[a] " " pdata[a] pdata a System.out.println(stb.toString()) System.out.println System.out System System.out stb.toString() stb.toString stb int[] pdata pdata public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int[] data = new int[N];
		for (int i = 0; i < N; i++) {
			data[i] = scn.nextInt();
		}
		show(data);
		for (int j = 1; j < N; j++) {
			int v = data[j];
			int w = j - 1;
			while (w >= 0 && data[w] > v) {
				data[w + 1] = data[w];
				w--;
			}
			data[w + 1] = v;
			show(data);
		}

	}

	static void show(int[] pdata) {
		StringBuffer stb = new StringBuffer();
		stb.append(pdata[0]);
		for (int a = 1; a < pdata.length; a++) {
			stb.append(" " + pdata[a]);
		}
		System.out.println(stb.toString());
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int[] data = new int[N];
		for (int i = 0; i < N; i++) {
			data[i] = scn.nextInt();
		}
		show(data);
		for (int j = 1; j < N; j++) {
			int v = data[j];
			int w = j - 1;
			while (w >= 0 && data[w] > v) {
				data[w + 1] = data[w];
				w--;
			}
			data[w + 1] = v;
			show(data);
		}

	}

	static void show(int[] pdata) {
		StringBuffer stb = new StringBuffer();
		stb.append(pdata[0]);
		for (int a = 1; a < pdata.length; a++) {
			stb.append(" " + pdata[a]);
		}
		System.out.println(stb.toString());
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int[] data = new int[N];
		for (int i = 0; i < N; i++) {
			data[i] = scn.nextInt();
		}
		show(data);
		for (int j = 1; j < N; j++) {
			int v = data[j];
			int w = j - 1;
			while (w >= 0 && data[w] > v) {
				data[w + 1] = data[w];
				w--;
			}
			data[w + 1] = v;
			show(data);
		}

	}

	static void show(int[] pdata) {
		StringBuffer stb = new StringBuffer();
		stb.append(pdata[0]);
		for (int a = 1; a < pdata.length; a++) {
			stb.append(" " + pdata[a]);
		}
		System.out.println(stb.toString());
	}
}

