import java.util.*;

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

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