import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		
		int n=sc.nextInt();
		int[] in=new int[n];
		for (int i=0;sc.hasNext();i++)
			in[i]=sc.nextInt();
		
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < i; j++) {
				if (in[i] < in[j]) {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					}

			}System.out.print(in[0]);
					for (int l = 1; l < n; l++)
						System.out.print(" " + in[l]);
					System.out.println();
		}

	}

} import java.io.FileReader; FileReader java.io import java.io.IOException; IOException java.io import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		
		int n=sc.nextInt();
		int[] in=new int[n];
		for (int i=0;sc.hasNext();i++)
			in[i]=sc.nextInt();
		
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < i; j++) {
				if (in[i] < in[j]) {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					}

			}System.out.print(in[0]);
					for (int l = 1; l < n; l++)
						System.out.print(" " + in[l]);
					System.out.println();
		}

	}

} Main public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		
		int n=sc.nextInt();
		int[] in=new int[n];
		for (int i=0;sc.hasNext();i++)
			in[i]=sc.nextInt();
		
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < i; j++) {
				if (in[i] < in[j]) {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					}

			}System.out.print(in[0]);
					for (int l = 1; l < n; l++)
						System.out.print(" " + in[l]);
					System.out.println();
		}

	} main {
		Scanner sc = new Scanner(System.in);
		
		int n=sc.nextInt();
		int[] in=new int[n];
		for (int i=0;sc.hasNext();i++)
			in[i]=sc.nextInt();
		
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < i; j++) {
				if (in[i] < in[j]) {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					}

			}System.out.print(in[0]);
					for (int l = 1; l < n; l++)
						System.out.print(" " + in[l]);
					System.out.println();
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] in=new int[n]; in new int[n] n for (int i=0;sc.hasNext();i++)
			in[i]=sc.nextInt(); int i=0; int i=0; i 0 sc.hasNext() sc.hasNext sc i++ i++ i in[i]=sc.nextInt(); in[i]=sc.nextInt() in[i] in i sc.nextInt() sc.nextInt sc for (int i = 0; i < n; i++) {
			for (int j = 0; j < i; j++) {
				if (in[i] < in[j]) {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					}

			}System.out.print(in[0]);
					for (int l = 1; l < n; l++)
						System.out.print(" " + in[l]);
					System.out.println();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			for (int j = 0; j < i; j++) {
				if (in[i] < in[j]) {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					}

			}System.out.print(in[0]);
					for (int l = 1; l < n; l++)
						System.out.print(" " + in[l]);
					System.out.println();
		} {
			for (int j = 0; j < i; j++) {
				if (in[i] < in[j]) {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					}

			}System.out.print(in[0]);
					for (int l = 1; l < n; l++)
						System.out.print(" " + in[l]);
					System.out.println();
		} for (int j = 0; j < i; j++) {
				if (in[i] < in[j]) {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					}

			} int j = 0; int j = 0; j 0 j < i j i j++ j++ j {
				if (in[i] < in[j]) {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					}

			} {
				if (in[i] < in[j]) {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					}

			} if (in[i] < in[j]) {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					} in[i] < in[j] in[i] in i in[j] in j {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					} int tmp = in[i]; tmp in[i] in i for (int l=i; l > j; l--)
						in[l] = in[l - 1]; int l=i; int l=i; l i l > j l j l-- l-- l in[l] = in[l - 1]; in[l] = in[l - 1] in[l] in l in[l - 1] in l - 1 l 1 in[j] = tmp in[j] in j tmp break; System.out.print(in[0]) System.out.print System.out System System.out in[0] in 0 for (int l = 1; l < n; l++)
						System.out.print(" " + in[l]); int l = 1; int l = 1; l 1 l < n l n l++ l++ l System.out.print(" " + in[l]); System.out.print(" " + in[l]) System.out.print System.out System System.out " " + in[l] " " in[l] in l System.out.println() System.out.println System.out System System.out String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		
		int n=sc.nextInt();
		int[] in=new int[n];
		for (int i=0;sc.hasNext();i++)
			in[i]=sc.nextInt();
		
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < i; j++) {
				if (in[i] < in[j]) {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					}

			}System.out.print(in[0]);
					for (int l = 1; l < n; l++)
						System.out.print(" " + in[l]);
					System.out.println();
		}

	}

} public class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		
		int n=sc.nextInt();
		int[] in=new int[n];
		for (int i=0;sc.hasNext();i++)
			in[i]=sc.nextInt();
		
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < i; j++) {
				if (in[i] < in[j]) {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					}

			}System.out.print(in[0]);
					for (int l = 1; l < n; l++)
						System.out.print(" " + in[l]);
					System.out.println();
		}

	}

} Main
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		
		int n=sc.nextInt();
		int[] in=new int[n];
		for (int i=0;sc.hasNext();i++)
			in[i]=sc.nextInt();
		
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < i; j++) {
				if (in[i] < in[j]) {
					int tmp = in[i];
					for (int l=i; l > j; l--)
						in[l] = in[l - 1];
					in[j] = tmp;break;
					}

			}System.out.print(in[0]);
					for (int l = 1; l < n; l++)
						System.out.print(" " + in[l]);
					System.out.println();
		}

	}

}