import java.util.Scanner;
public class Main {
	Scanner sc = new Scanner(System.in);
	int N;	//要素数
	int v=0;	//保存用変数
	int j=0;	//添字のための変数
	int[] A;
	
	public void input() {
		N = sc.nextInt();
		A = new int[N];
		for(int i=0; i<N; i++) { A[i] = sc.nextInt(); }
	}
	
	//ソート部分
	public void conpute() {
		output();
		for(int i=1; i<=N-1; i++) {
			v = A[i];
			j = i-1;
			while(j>=0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			output();
		}
	}
	
	public void output() {
		System.out.print(A[0]);
		for(int i=1; i<N; i++) {
			System.out.print(" "+A[i]);
		}
		System.out.println();
	}
	
	public static void main(String[] args) {
		Main obj = new Main();
		obj.input();
		obj.conpute();
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	Scanner sc = new Scanner(System.in);
	int N;	//要素数
	int v=0;	//保存用変数
	int j=0;	//添字のための変数
	int[] A;
	
	public void input() {
		N = sc.nextInt();
		A = new int[N];
		for(int i=0; i<N; i++) { A[i] = sc.nextInt(); }
	}
	
	//ソート部分
	public void conpute() {
		output();
		for(int i=1; i<=N-1; i++) {
			v = A[i];
			j = i-1;
			while(j>=0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			output();
		}
	}
	
	public void output() {
		System.out.print(A[0]);
		for(int i=1; i<N; i++) {
			System.out.print(" "+A[i]);
		}
		System.out.println();
	}
	
	public static void main(String[] args) {
		Main obj = new Main();
		obj.input();
		obj.conpute();
	}
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N;	//要素数 N int v=0;	//保存用変数 v 0 int j=0;	//添字のための変数 j 0 int[] A; A public void input() {
		N = sc.nextInt();
		A = new int[N];
		for(int i=0; i<N; i++) { A[i] = sc.nextInt(); }
	} input {
		N = sc.nextInt();
		A = new int[N];
		for(int i=0; i<N; i++) { A[i] = sc.nextInt(); }
	} N = sc.nextInt() N sc.nextInt() sc.nextInt sc 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] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc //ソート部分
	public void conpute() {
		output();
		for(int i=1; i<=N-1; i++) {
			v = A[i];
			j = i-1;
			while(j>=0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			output();
		}
	} conpute {
		output();
		for(int i=1; i<=N-1; i++) {
			v = A[i];
			j = i-1;
			while(j>=0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			output();
		}
	} output() output for(int i=1; i<=N-1; i++) {
			v = A[i];
			j = i-1;
			while(j>=0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			output();
		} int i=1; int i=1; i 1 i<=N-1 i N-1 N 1 i++ i++ i {
			v = A[i];
			j = i-1;
			while(j>=0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			output();
		} {
			v = A[i];
			j = i-1;
			while(j>=0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			output();
		} 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 output() output public void output() {
		System.out.print(A[0]);
		for(int i=1; i<N; i++) {
			System.out.print(" "+A[i]);
		}
		System.out.println();
	} output {
		System.out.print(A[0]);
		for(int i=1; i<N; i++) {
			System.out.print(" "+A[i]);
		}
		System.out.println();
	} System.out.print(A[0]) System.out.print System.out System System.out A[0] A 0 for(int i=1; i<N; i++) {
			System.out.print(" "+A[i]);
		} int i=1; int i=1; i 1 i<N i N 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() System.out.println System.out System System.out public static void main(String[] args) {
		Main obj = new Main();
		obj.input();
		obj.conpute();
	} main {
		Main obj = new Main();
		obj.input();
		obj.conpute();
	} Main obj = new Main(); obj new Main() obj.input() obj.input obj obj.conpute() obj.conpute obj String[] args args public class Main {
	Scanner sc = new Scanner(System.in);
	int N;	//要素数
	int v=0;	//保存用変数
	int j=0;	//添字のための変数
	int[] A;
	
	public void input() {
		N = sc.nextInt();
		A = new int[N];
		for(int i=0; i<N; i++) { A[i] = sc.nextInt(); }
	}
	
	//ソート部分
	public void conpute() {
		output();
		for(int i=1; i<=N-1; i++) {
			v = A[i];
			j = i-1;
			while(j>=0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			output();
		}
	}
	
	public void output() {
		System.out.print(A[0]);
		for(int i=1; i<N; i++) {
			System.out.print(" "+A[i]);
		}
		System.out.println();
	}
	
	public static void main(String[] args) {
		Main obj = new Main();
		obj.input();
		obj.conpute();
	}
} public class Main {
	Scanner sc = new Scanner(System.in);
	int N;	//要素数
	int v=0;	//保存用変数
	int j=0;	//添字のための変数
	int[] A;
	
	public void input() {
		N = sc.nextInt();
		A = new int[N];
		for(int i=0; i<N; i++) { A[i] = sc.nextInt(); }
	}
	
	//ソート部分
	public void conpute() {
		output();
		for(int i=1; i<=N-1; i++) {
			v = A[i];
			j = i-1;
			while(j>=0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			output();
		}
	}
	
	public void output() {
		System.out.print(A[0]);
		for(int i=1; i<N; i++) {
			System.out.print(" "+A[i]);
		}
		System.out.println();
	}
	
	public static void main(String[] args) {
		Main obj = new Main();
		obj.input();
		obj.conpute();
	}
} Main
import java.util.Scanner;
public class Main {
	Scanner sc = new Scanner(System.in);
	int N;	//要素数
	int v=0;	//保存用変数
	int j=0;	//添字のための変数
	int[] A;
	
	public void input() {
		N = sc.nextInt();
		A = new int[N];
		for(int i=0; i<N; i++) { A[i] = sc.nextInt(); }
	}
	
	//ソート部分
	public void conpute() {
		output();
		for(int i=1; i<=N-1; i++) {
			v = A[i];
			j = i-1;
			while(j>=0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			output();
		}
	}
	
	public void output() {
		System.out.print(A[0]);
		for(int i=1; i<N; i++) {
			System.out.print(" "+A[i]);
		}
		System.out.println();
	}
	
	public static void main(String[] args) {
		Main obj = new Main();
		obj.input();
		obj.conpute();
	}
}

