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

	}
	
	public static void show(int[] ary){
		for(int i=0;i<ary.length-1;i++){
			System.out.print(ary[i]+" ");
		}
		cout(ary[ary.length-1]);
	}
	
	public static void cout(String n){
		System.out.println(n);
	}
	
	public static void cout(int n){
		System.out.println(n);
	}
} import java.util.*; util.* java public class Main {
	
	
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for(int i=0;i<N;i++) A[i] = sc.nextInt();
		show(A);
		for(int i=1;i<N;i++){
			int v = A[i];
			int j = i-1;
			while(j>=0 && A[j]>v){
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			show(A);
		}

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

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

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

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

	}
	
	public static void show(int[] ary){
		for(int i=0;i<ary.length-1;i++){
			System.out.print(ary[i]+" ");
		}
		cout(ary[ary.length-1]);
	}
	
	public static void cout(String n){
		System.out.println(n);
	}
	
	public static void cout(int n){
		System.out.println(n);
	}
} Main
import java.util.*;
 
public class Main {
	
	
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for(int i=0;i<N;i++) A[i] = sc.nextInt();
		show(A);
		for(int i=1;i<N;i++){
			int v = A[i];
			int j = i-1;
			while(j>=0 && A[j]>v){
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			show(A);
		}

	}
	
	public static void show(int[] ary){
		for(int i=0;i<ary.length-1;i++){
			System.out.print(ary[i]+" ");
		}
		cout(ary[ary.length-1]);
	}
	
	public static void cout(String n){
		System.out.println(n);
	}
	
	public static void cout(int n){
		System.out.println(n);
	}
}