import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] arr = new int[n];
		for(int i=0; i<n; i++) {
			arr[i] = scan.nextInt();
		}
		Sort sort = new Sort();
		arr = sort.insertion(arr);
	}
}

class Sort{
	public int[] insertion(int[] A){
                showArray(A);
		for(int i=1; i<A.length; 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;
			showArray(A);
		}
		return A;
	}
	public void showArray(int[] A){
		for(int i=0; i<A.length; i++){
			System.out.print(A[i]);
			if(i != A.length-1)System.out.print(" ");
		}
		System.out.println("");
	}
} import java.util.*; util.* java class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] arr = new int[n];
		for(int i=0; i<n; i++) {
			arr[i] = scan.nextInt();
		}
		Sort sort = new Sort();
		arr = sort.insertion(arr);
	}
} Main public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] arr = new int[n];
		for(int i=0; i<n; i++) {
			arr[i] = scan.nextInt();
		}
		Sort sort = new Sort();
		arr = sort.insertion(arr);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] arr = new int[n];
		for(int i=0; i<n; i++) {
			arr[i] = scan.nextInt();
		}
		Sort sort = new Sort();
		arr = sort.insertion(arr);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[] arr = new int[n]; arr new int[n] n for(int i=0; i<n; i++) {
			arr[i] = scan.nextInt();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			arr[i] = scan.nextInt();
		} {
			arr[i] = scan.nextInt();
		} arr[i] = scan.nextInt() arr[i] arr i scan.nextInt() scan.nextInt scan Sort sort = new Sort(); sort new Sort() arr = sort.insertion(arr) arr sort.insertion(arr) sort.insertion sort arr String args[] args class Sort{
	public int[] insertion(int[] A){
                showArray(A);
		for(int i=1; i<A.length; 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;
			showArray(A);
		}
		return A;
	}
	public void showArray(int[] A){
		for(int i=0; i<A.length; i++){
			System.out.print(A[i]);
			if(i != A.length-1)System.out.print(" ");
		}
		System.out.println("");
	}
} Sort public int[] insertion(int[] A){
                showArray(A);
		for(int i=1; i<A.length; 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;
			showArray(A);
		}
		return A;
	} insertion {
                showArray(A);
		for(int i=1; i<A.length; 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;
			showArray(A);
		}
		return A;
	} showArray(A) showArray A for(int i=1; i<A.length; 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;
			showArray(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];
			int j = i-1;
			while(j >= 0 && A[j] > v){
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			showArray(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;
			showArray(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 showArray(A) showArray A return A; A int[] A A public void showArray(int[] A){
		for(int i=0; i<A.length; i++){
			System.out.print(A[i]);
			if(i != A.length-1)System.out.print(" ");
		}
		System.out.println("");
	} showArray {
		for(int i=0; i<A.length; i++){
			System.out.print(A[i]);
			if(i != A.length-1)System.out.print(" ");
		}
		System.out.println("");
	} for(int i=0; i<A.length; i++){
			System.out.print(A[i]);
			if(i != A.length-1)System.out.print(" ");
		} 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(" ");
		} {
			System.out.print(A[i]);
			if(i != A.length-1)System.out.print(" ");
		} 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(" "); 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 scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] arr = new int[n];
		for(int i=0; i<n; i++) {
			arr[i] = scan.nextInt();
		}
		Sort sort = new Sort();
		arr = sort.insertion(arr);
	}
}

class Sort{
	public int[] insertion(int[] A){
                showArray(A);
		for(int i=1; i<A.length; 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;
			showArray(A);
		}
		return A;
	}
	public void showArray(int[] A){
		for(int i=0; i<A.length; i++){
			System.out.print(A[i]);
			if(i != A.length-1)System.out.print(" ");
		}
		System.out.println("");
	}
}