import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[] ary = new int[n];
		for (int i=0; i<n; i++) {
			ary[i] = stdIn.nextInt();
		}
		output(ary);
		for (int i=1; i<ary.length; i++) {
			int key = ary[i];
			int j = i - 1;
			while (j>=0 && ary[j]>key) {
				ary[j+1] = ary[j];
				j--;
			}
			ary[j+1] = key;
			output(ary);
		}
	}
	static void output(int[] a) {
		for (int i=0; i<a.length; i++) {
			System.out.print(a[i]);
			if(i<a.length-1)
				System.out.print(" ");
			else 
				System.out.println();
		}
	}
} import java.util.*; util.* java class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[] ary = new int[n];
		for (int i=0; i<n; i++) {
			ary[i] = stdIn.nextInt();
		}
		output(ary);
		for (int i=1; i<ary.length; i++) {
			int key = ary[i];
			int j = i - 1;
			while (j>=0 && ary[j]>key) {
				ary[j+1] = ary[j];
				j--;
			}
			ary[j+1] = key;
			output(ary);
		}
	}
	static void output(int[] a) {
		for (int i=0; i<a.length; i++) {
			System.out.print(a[i]);
			if(i<a.length-1)
				System.out.print(" ");
			else 
				System.out.println();
		}
	}
} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[] ary = new int[n];
		for (int i=0; i<n; i++) {
			ary[i] = stdIn.nextInt();
		}
		output(ary);
		for (int i=1; i<ary.length; i++) {
			int key = ary[i];
			int j = i - 1;
			while (j>=0 && ary[j]>key) {
				ary[j+1] = ary[j];
				j--;
			}
			ary[j+1] = key;
			output(ary);
		}
	} main {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[] ary = new int[n];
		for (int i=0; i<n; i++) {
			ary[i] = stdIn.nextInt();
		}
		output(ary);
		for (int i=1; i<ary.length; i++) {
			int key = ary[i];
			int j = i - 1;
			while (j>=0 && ary[j]>key) {
				ary[j+1] = ary[j];
				j--;
			}
			ary[j+1] = key;
			output(ary);
		}
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int[] ary = new int[n]; ary new int[n] n for (int i=0; i<n; i++) {
			ary[i] = stdIn.nextInt();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			ary[i] = stdIn.nextInt();
		} {
			ary[i] = stdIn.nextInt();
		} ary[i] = stdIn.nextInt() ary[i] ary i stdIn.nextInt() stdIn.nextInt stdIn output(ary) output ary for (int i=1; i<ary.length; i++) {
			int key = ary[i];
			int j = i - 1;
			while (j>=0 && ary[j]>key) {
				ary[j+1] = ary[j];
				j--;
			}
			ary[j+1] = key;
			output(ary);
		} int i=1; int i=1; i 1 i<ary.length i ary.length ary ary.length i++ i++ i {
			int key = ary[i];
			int j = i - 1;
			while (j>=0 && ary[j]>key) {
				ary[j+1] = ary[j];
				j--;
			}
			ary[j+1] = key;
			output(ary);
		} {
			int key = ary[i];
			int j = i - 1;
			while (j>=0 && ary[j]>key) {
				ary[j+1] = ary[j];
				j--;
			}
			ary[j+1] = key;
			output(ary);
		} int key = ary[i]; key ary[i] ary i int j = i - 1; j i - 1 i 1 while (j>=0 && ary[j]>key) {
				ary[j+1] = ary[j];
				j--;
			} j>=0 && ary[j]>key j>=0 j 0 ary[j]>key ary[j] ary j key {
				ary[j+1] = ary[j];
				j--;
			} ary[j+1] = ary[j] ary[j+1] ary j+1 j 1 ary[j] ary j j-- j ary[j+1] = key ary[j+1] ary j+1 j 1 key output(ary) output ary String[] args args static void output(int[] a) {
		for (int i=0; i<a.length; i++) {
			System.out.print(a[i]);
			if(i<a.length-1)
				System.out.print(" ");
			else 
				System.out.println();
		}
	} output {
		for (int i=0; i<a.length; i++) {
			System.out.print(a[i]);
			if(i<a.length-1)
				System.out.print(" ");
			else 
				System.out.println();
		}
	} for (int i=0; i<a.length; i++) {
			System.out.print(a[i]);
			if(i<a.length-1)
				System.out.print(" ");
			else 
				System.out.println();
		} int i=0; int i=0; i 0 i<a.length i a.length a a.length i++ i++ i {
			System.out.print(a[i]);
			if(i<a.length-1)
				System.out.print(" ");
			else 
				System.out.println();
		} {
			System.out.print(a[i]);
			if(i<a.length-1)
				System.out.print(" ");
			else 
				System.out.println();
		} System.out.print(a[i]) System.out.print System.out System System.out a[i] a i if(i<a.length-1)
				System.out.print(" ");
			else 
				System.out.println(); i<a.length-1 i a.length-1 a.length a a.length 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out int[] a a
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[] ary = new int[n];
		for (int i=0; i<n; i++) {
			ary[i] = stdIn.nextInt();
		}
		output(ary);
		for (int i=1; i<ary.length; i++) {
			int key = ary[i];
			int j = i - 1;
			while (j>=0 && ary[j]>key) {
				ary[j+1] = ary[j];
				j--;
			}
			ary[j+1] = key;
			output(ary);
		}
	}
	static void output(int[] a) {
		for (int i=0; i<a.length; i++) {
			System.out.print(a[i]);
			if(i<a.length-1)
				System.out.print(" ");
			else 
				System.out.println();
		}
	}
}