import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int N = in.nextInt();
		
		int a[] = new int[100];
		
		for (int i = 0; i < N; i++) {
			int val = in.nextInt();
			a[i] = val;
		}
		
		for (int i = 1; i < N; i++) {
			output(a, N);
			int val = a[i];
			int j = i-1;
			while(j >= 0 && val < a[j]) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = val;
		}
		output(a, N);
	}
	
	static void output(int[] a, int N) {
		for (int i = 0; i < N-1; i++) {
			System.out.print(a[i]+ " ");
		}
		System.out.println(a[N-1]);
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int N = in.nextInt();
		
		int a[] = new int[100];
		
		for (int i = 0; i < N; i++) {
			int val = in.nextInt();
			a[i] = val;
		}
		
		for (int i = 1; i < N; i++) {
			output(a, N);
			int val = a[i];
			int j = i-1;
			while(j >= 0 && val < a[j]) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = val;
		}
		output(a, N);
	}
	
	static void output(int[] a, int N) {
		for (int i = 0; i < N-1; i++) {
			System.out.print(a[i]+ " ");
		}
		System.out.println(a[N-1]);
	}
} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int N = in.nextInt();
		
		int a[] = new int[100];
		
		for (int i = 0; i < N; i++) {
			int val = in.nextInt();
			a[i] = val;
		}
		
		for (int i = 1; i < N; i++) {
			output(a, N);
			int val = a[i];
			int j = i-1;
			while(j >= 0 && val < a[j]) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = val;
		}
		output(a, N);
	} main {
		Scanner in = new Scanner(System.in);
		
		int N = in.nextInt();
		
		int a[] = new int[100];
		
		for (int i = 0; i < N; i++) {
			int val = in.nextInt();
			a[i] = val;
		}
		
		for (int i = 1; i < N; i++) {
			output(a, N);
			int val = a[i];
			int j = i-1;
			while(j >= 0 && val < a[j]) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = val;
		}
		output(a, N);
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int a[] = new int[100]; a new int[100] 100 for (int i = 0; i < N; i++) {
			int val = in.nextInt();
			a[i] = val;
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			int val = in.nextInt();
			a[i] = val;
		} {
			int val = in.nextInt();
			a[i] = val;
		} int val = in.nextInt(); val in.nextInt() in.nextInt in a[i] = val a[i] a i val for (int i = 1; i < N; i++) {
			output(a, N);
			int val = a[i];
			int j = i-1;
			while(j >= 0 && val < a[j]) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = val;
		} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
			output(a, N);
			int val = a[i];
			int j = i-1;
			while(j >= 0 && val < a[j]) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = val;
		} {
			output(a, N);
			int val = a[i];
			int j = i-1;
			while(j >= 0 && val < a[j]) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = val;
		} output(a, N) output a N int val = a[i]; val a[i] a i int j = i-1; j i-1 i 1 while(j >= 0 && val < a[j]) {
				a[j+1] = a[j];
				j--;
			} j >= 0 && val < a[j] j >= 0 j 0 val < a[j] val a[j] a j {
				a[j+1] = a[j];
				j--;
			} a[j+1] = a[j] a[j+1] a j+1 j 1 a[j] a j j-- j a[j+1] = val a[j+1] a j+1 j 1 val output(a, N) output a N String[] args args static void output(int[] a, int N) {
		for (int i = 0; i < N-1; i++) {
			System.out.print(a[i]+ " ");
		}
		System.out.println(a[N-1]);
	} output {
		for (int i = 0; i < N-1; i++) {
			System.out.print(a[i]+ " ");
		}
		System.out.println(a[N-1]);
	} for (int i = 0; i < N-1; i++) {
			System.out.print(a[i]+ " ");
		} int i = 0; int i = 0; i 0 i < N-1 i N-1 N 1 i++ i++ i {
			System.out.print(a[i]+ " ");
		} {
			System.out.print(a[i]+ " ");
		} System.out.print(a[i]+ " ") System.out.print System.out System System.out a[i]+ " " a[i] a i " " System.out.println(a[N-1]) System.out.println System.out System System.out a[N-1] a N-1 N 1 int[] a a int N N public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int N = in.nextInt();
		
		int a[] = new int[100];
		
		for (int i = 0; i < N; i++) {
			int val = in.nextInt();
			a[i] = val;
		}
		
		for (int i = 1; i < N; i++) {
			output(a, N);
			int val = a[i];
			int j = i-1;
			while(j >= 0 && val < a[j]) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = val;
		}
		output(a, N);
	}
	
	static void output(int[] a, int N) {
		for (int i = 0; i < N-1; i++) {
			System.out.print(a[i]+ " ");
		}
		System.out.println(a[N-1]);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int N = in.nextInt();
		
		int a[] = new int[100];
		
		for (int i = 0; i < N; i++) {
			int val = in.nextInt();
			a[i] = val;
		}
		
		for (int i = 1; i < N; i++) {
			output(a, N);
			int val = a[i];
			int j = i-1;
			while(j >= 0 && val < a[j]) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = val;
		}
		output(a, N);
	}
	
	static void output(int[] a, int N) {
		for (int i = 0; i < N-1; i++) {
			System.out.print(a[i]+ " ");
		}
		System.out.println(a[N-1]);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int N = in.nextInt();
		
		int a[] = new int[100];
		
		for (int i = 0; i < N; i++) {
			int val = in.nextInt();
			a[i] = val;
		}
		
		for (int i = 1; i < N; i++) {
			output(a, N);
			int val = a[i];
			int j = i-1;
			while(j >= 0 && val < a[j]) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = val;
		}
		output(a, N);
	}
	
	static void output(int[] a, int N) {
		for (int i = 0; i < N-1; i++) {
			System.out.print(a[i]+ " ");
		}
		System.out.println(a[N-1]);
	}
}

