import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt(), A[]=new int[n];
		for(int i=0;i<n;i++)A[i]=in.nextInt();
		trace(A);
		insertSort(A);
	}
	
	static void insertSort(int[] A) {
		for(int i=1;i<A.length;i++) {
			int v=A[i], j=i-1;
			while(j>=0 && A[j]>v) {
				A[j+1]=A[j];
				j--;
			}
			A[j+1]=v;
			trace(A);
		}
		
	}
	
	static void trace(int[] A) {
		for(int i=0;i<A.length-1;i++)System.out.print(A[i]+" ");
		System.out.println(A[A.length-1]);
	}

}
 import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt(), A[]=new int[n];
		for(int i=0;i<n;i++)A[i]=in.nextInt();
		trace(A);
		insertSort(A);
	}
	
	static void insertSort(int[] A) {
		for(int i=1;i<A.length;i++) {
			int v=A[i], j=i-1;
			while(j>=0 && A[j]>v) {
				A[j+1]=A[j];
				j--;
			}
			A[j+1]=v;
			trace(A);
		}
		
	}
	
	static void trace(int[] A) {
		for(int i=0;i<A.length-1;i++)System.out.print(A[i]+" ");
		System.out.println(A[A.length-1]);
	}

} Main public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt(), A[]=new int[n];
		for(int i=0;i<n;i++)A[i]=in.nextInt();
		trace(A);
		insertSort(A);
	} main {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt(), A[]=new int[n];
		for(int i=0;i<n;i++)A[i]=in.nextInt();
		trace(A);
		insertSort(A);
	} Scanner in=new Scanner(System.in); in new Scanner(System.in) int n=in.nextInt() n in.nextInt() in.nextInt in A[]=new int[n]; A new int[n] n for(int i=0;i<n;i++)A[i]=in.nextInt(); int i=0; int i=0; i 0 i<n i n i++ i++ i A[i]=in.nextInt(); A[i]=in.nextInt() A[i] A i in.nextInt() in.nextInt in trace(A) trace A insertSort(A) insertSort A String[] args args static void insertSort(int[] A) {
		for(int i=1;i<A.length;i++) {
			int v=A[i], j=i-1;
			while(j>=0 && A[j]>v) {
				A[j+1]=A[j];
				j--;
			}
			A[j+1]=v;
			trace(A);
		}
		
	} insertSort {
		for(int i=1;i<A.length;i++) {
			int v=A[i], j=i-1;
			while(j>=0 && A[j]>v) {
				A[j+1]=A[j];
				j--;
			}
			A[j+1]=v;
			trace(A);
		}
		
	} for(int i=1;i<A.length;i++) {
			int v=A[i], j=i-1;
			while(j>=0 && A[j]>v) {
				A[j+1]=A[j];
				j--;
			}
			A[j+1]=v;
			trace(A);
		} int i=1; int i=1; i 1 i<A.length i A.length A A.length i++ i++ i {
			int v=A[i], j=i-1;
			while(j>=0 && A[j]>v) {
				A[j+1]=A[j];
				j--;
			}
			A[j+1]=v;
			trace(A);
		} {
			int v=A[i], j=i-1;
			while(j>=0 && A[j]>v) {
				A[j+1]=A[j];
				j--;
			}
			A[j+1]=v;
			trace(A);
		} int v=A[i] v A[i] A i j=i-1; j i-1 i 1 while(j>=0 && A[j]>v) {
				A[j+1]=A[j];
				j--;
			} j>=0 && A[j]>v j>=0 j 0 A[j]>v A[j] A j v {
				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]=v A[j+1] A j+1 j 1 v trace(A) trace A int[] A A static void trace(int[] A) {
		for(int i=0;i<A.length-1;i++)System.out.print(A[i]+" ");
		System.out.println(A[A.length-1]);
	} trace {
		for(int i=0;i<A.length-1;i++)System.out.print(A[i]+" ");
		System.out.println(A[A.length-1]);
	} for(int i=0;i<A.length-1;i++)System.out.print(A[i]+" "); int i=0; int i=0; i 0 i<A.length-1 i A.length-1 A.length A A.length 1 i++ i++ 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[A.length-1]) System.out.println System.out System System.out A[A.length-1] A A.length-1 A.length A A.length 1 int[] A A public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt(), A[]=new int[n];
		for(int i=0;i<n;i++)A[i]=in.nextInt();
		trace(A);
		insertSort(A);
	}
	
	static void insertSort(int[] A) {
		for(int i=1;i<A.length;i++) {
			int v=A[i], j=i-1;
			while(j>=0 && A[j]>v) {
				A[j+1]=A[j];
				j--;
			}
			A[j+1]=v;
			trace(A);
		}
		
	}
	
	static void trace(int[] A) {
		for(int i=0;i<A.length-1;i++)System.out.print(A[i]+" ");
		System.out.println(A[A.length-1]);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt(), A[]=new int[n];
		for(int i=0;i<n;i++)A[i]=in.nextInt();
		trace(A);
		insertSort(A);
	}
	
	static void insertSort(int[] A) {
		for(int i=1;i<A.length;i++) {
			int v=A[i], j=i-1;
			while(j>=0 && A[j]>v) {
				A[j+1]=A[j];
				j--;
			}
			A[j+1]=v;
			trace(A);
		}
		
	}
	
	static void trace(int[] A) {
		for(int i=0;i<A.length-1;i++)System.out.print(A[i]+" ");
		System.out.println(A[A.length-1]);
	}

} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt(), A[]=new int[n];
		for(int i=0;i<n;i++)A[i]=in.nextInt();
		trace(A);
		insertSort(A);
	}
	
	static void insertSort(int[] A) {
		for(int i=1;i<A.length;i++) {
			int v=A[i], j=i-1;
			while(j>=0 && A[j]>v) {
				A[j+1]=A[j];
				j--;
			}
			A[j+1]=v;
			trace(A);
		}
		
	}
	
	static void trace(int[] A) {
		for(int i=0;i<A.length-1;i++)System.out.print(A[i]+" ");
		System.out.println(A[A.length-1]);
	}

}

