import java.util.Scanner;


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

	}
	static void Sort(int[] num){
		int v,j;
		for(int i=0;i<num.length;i++){
			v = num[i];
			j = i-1;
			while(j>=0 && num[j]>v){
				num[j+1] = num[j];
				j--;
			}
			num[j+1] = v;
			Print(num);
		}

	}

	static void Print(int[] a){
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<a.length;i++){
			sb.append(a[i]);
			if(i<a.length-1)sb.append(" ");
		}
		System.out.println(sb);
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] num = new int[n];
		for(int i=0;i<n;i++){
			num[i] = sc.nextInt();
		}
		Sort(num);

	}
	static void Sort(int[] num){
		int v,j;
		for(int i=0;i<num.length;i++){
			v = num[i];
			j = i-1;
			while(j>=0 && num[j]>v){
				num[j+1] = num[j];
				j--;
			}
			num[j+1] = v;
			Print(num);
		}

	}

	static void Print(int[] a){
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<a.length;i++){
			sb.append(a[i]);
			if(i<a.length-1)sb.append(" ");
		}
		System.out.println(sb);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] num = new int[n];
		for(int i=0;i<n;i++){
			num[i] = sc.nextInt();
		}
		Sort(num);

	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] num = new int[n];
		for(int i=0;i<n;i++){
			num[i] = sc.nextInt();
		}
		Sort(num);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] num = new int[n]; num new int[n] n for(int i=0;i<n;i++){
			num[i] = sc.nextInt();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			num[i] = sc.nextInt();
		} {
			num[i] = sc.nextInt();
		} num[i] = sc.nextInt() num[i] num i sc.nextInt() sc.nextInt sc Sort(num) Sort num String[] args args static void Sort(int[] num){
		int v,j;
		for(int i=0;i<num.length;i++){
			v = num[i];
			j = i-1;
			while(j>=0 && num[j]>v){
				num[j+1] = num[j];
				j--;
			}
			num[j+1] = v;
			Print(num);
		}

	} Sort {
		int v,j;
		for(int i=0;i<num.length;i++){
			v = num[i];
			j = i-1;
			while(j>=0 && num[j]>v){
				num[j+1] = num[j];
				j--;
			}
			num[j+1] = v;
			Print(num);
		}

	} int v v j; j for(int i=0;i<num.length;i++){
			v = num[i];
			j = i-1;
			while(j>=0 && num[j]>v){
				num[j+1] = num[j];
				j--;
			}
			num[j+1] = v;
			Print(num);
		} int i=0; int i=0; i 0 i<num.length i num.length num num.length i++ i++ i {
			v = num[i];
			j = i-1;
			while(j>=0 && num[j]>v){
				num[j+1] = num[j];
				j--;
			}
			num[j+1] = v;
			Print(num);
		} {
			v = num[i];
			j = i-1;
			while(j>=0 && num[j]>v){
				num[j+1] = num[j];
				j--;
			}
			num[j+1] = v;
			Print(num);
		} v = num[i] v num[i] num i j = i-1 j i-1 i 1 while(j>=0 && num[j]>v){
				num[j+1] = num[j];
				j--;
			} j>=0 && num[j]>v j>=0 j 0 num[j]>v num[j] num j v {
				num[j+1] = num[j];
				j--;
			} num[j+1] = num[j] num[j+1] num j+1 j 1 num[j] num j j-- j num[j+1] = v num[j+1] num j+1 j 1 v Print(num) Print num int[] num num static void Print(int[] a){
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<a.length;i++){
			sb.append(a[i]);
			if(i<a.length-1)sb.append(" ");
		}
		System.out.println(sb);
	} Print {
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<a.length;i++){
			sb.append(a[i]);
			if(i<a.length-1)sb.append(" ");
		}
		System.out.println(sb);
	} StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i=0;i<a.length;i++){
			sb.append(a[i]);
			if(i<a.length-1)sb.append(" ");
		} int i=0; int i=0; i 0 i<a.length i a.length a a.length i++ i++ i {
			sb.append(a[i]);
			if(i<a.length-1)sb.append(" ");
		} {
			sb.append(a[i]);
			if(i<a.length-1)sb.append(" ");
		} sb.append(a[i]) sb.append sb a[i] a i if(i<a.length-1)sb.append(" "); i<a.length-1 i a.length-1 a.length a a.length 1 sb.append(" ") sb.append sb " " System.out.println(sb) System.out.println System.out System System.out sb int[] a a public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] num = new int[n];
		for(int i=0;i<n;i++){
			num[i] = sc.nextInt();
		}
		Sort(num);

	}
	static void Sort(int[] num){
		int v,j;
		for(int i=0;i<num.length;i++){
			v = num[i];
			j = i-1;
			while(j>=0 && num[j]>v){
				num[j+1] = num[j];
				j--;
			}
			num[j+1] = v;
			Print(num);
		}

	}

	static void Print(int[] a){
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<a.length;i++){
			sb.append(a[i]);
			if(i<a.length-1)sb.append(" ");
		}
		System.out.println(sb);
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] num = new int[n];
		for(int i=0;i<n;i++){
			num[i] = sc.nextInt();
		}
		Sort(num);

	}
	static void Sort(int[] num){
		int v,j;
		for(int i=0;i<num.length;i++){
			v = num[i];
			j = i-1;
			while(j>=0 && num[j]>v){
				num[j+1] = num[j];
				j--;
			}
			num[j+1] = v;
			Print(num);
		}

	}

	static void Print(int[] a){
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<a.length;i++){
			sb.append(a[i]);
			if(i<a.length-1)sb.append(" ");
		}
		System.out.println(sb);
	}
} Main
import java.util.Scanner;


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

	}
	static void Sort(int[] num){
		int v,j;
		for(int i=0;i<num.length;i++){
			v = num[i];
			j = i-1;
			while(j>=0 && num[j]>v){
				num[j+1] = num[j];
				j--;
			}
			num[j+1] = v;
			Print(num);
		}

	}

	static void Print(int[] a){
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<a.length;i++){
			sb.append(a[i]);
			if(i<a.length-1)sb.append(" ");
		}
		System.out.println(sb);
	}
}