import java.util.Scanner;

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

		int b,c;

		for(int i = 1; i < s; i++){
			for(int k = 0; k < s-1; k++){
				System.out.print(n[k] + " ");
			}
			System.out.println(n[s-1]);

			b = n[i];
			c = i-1;

			while(c >= 0 && n[c] > b){
				n[c+1] = n[c];
				c--;
			}
			n[c+1] = b;
		}
		for(int k = 0; k < s-1; k++){
			System.out.print(n[k] + " ") ;
		}
		System.out.println(n[s-1]);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int[] n = new int[s];
		
		for(int i= 0; i < s; i++){
			n[i] = sc.nextInt();
		}

		int b,c;

		for(int i = 1; i < s; i++){
			for(int k = 0; k < s-1; k++){
				System.out.print(n[k] + " ");
			}
			System.out.println(n[s-1]);

			b = n[i];
			c = i-1;

			while(c >= 0 && n[c] > b){
				n[c+1] = n[c];
				c--;
			}
			n[c+1] = b;
		}
		for(int k = 0; k < s-1; k++){
			System.out.print(n[k] + " ") ;
		}
		System.out.println(n[s-1]);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int[] n = new int[s];
		
		for(int i= 0; i < s; i++){
			n[i] = sc.nextInt();
		}

		int b,c;

		for(int i = 1; i < s; i++){
			for(int k = 0; k < s-1; k++){
				System.out.print(n[k] + " ");
			}
			System.out.println(n[s-1]);

			b = n[i];
			c = i-1;

			while(c >= 0 && n[c] > b){
				n[c+1] = n[c];
				c--;
			}
			n[c+1] = b;
		}
		for(int k = 0; k < s-1; k++){
			System.out.print(n[k] + " ") ;
		}
		System.out.println(n[s-1]);
	} main {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int[] n = new int[s];
		
		for(int i= 0; i < s; i++){
			n[i] = sc.nextInt();
		}

		int b,c;

		for(int i = 1; i < s; i++){
			for(int k = 0; k < s-1; k++){
				System.out.print(n[k] + " ");
			}
			System.out.println(n[s-1]);

			b = n[i];
			c = i-1;

			while(c >= 0 && n[c] > b){
				n[c+1] = n[c];
				c--;
			}
			n[c+1] = b;
		}
		for(int k = 0; k < s-1; k++){
			System.out.print(n[k] + " ") ;
		}
		System.out.println(n[s-1]);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int[] n = new int[s]; n new int[s] s for(int i= 0; i < s; i++){
			n[i] = sc.nextInt();
		} int i= 0; int i= 0; i 0 i < s i s i++ i++ i {
			n[i] = sc.nextInt();
		} {
			n[i] = sc.nextInt();
		} n[i] = sc.nextInt() n[i] n i sc.nextInt() sc.nextInt sc int b b c; c for(int i = 1; i < s; i++){
			for(int k = 0; k < s-1; k++){
				System.out.print(n[k] + " ");
			}
			System.out.println(n[s-1]);

			b = n[i];
			c = i-1;

			while(c >= 0 && n[c] > b){
				n[c+1] = n[c];
				c--;
			}
			n[c+1] = b;
		} int i = 1; int i = 1; i 1 i < s i s i++ i++ i {
			for(int k = 0; k < s-1; k++){
				System.out.print(n[k] + " ");
			}
			System.out.println(n[s-1]);

			b = n[i];
			c = i-1;

			while(c >= 0 && n[c] > b){
				n[c+1] = n[c];
				c--;
			}
			n[c+1] = b;
		} {
			for(int k = 0; k < s-1; k++){
				System.out.print(n[k] + " ");
			}
			System.out.println(n[s-1]);

			b = n[i];
			c = i-1;

			while(c >= 0 && n[c] > b){
				n[c+1] = n[c];
				c--;
			}
			n[c+1] = b;
		} for(int k = 0; k < s-1; k++){
				System.out.print(n[k] + " ");
			} int k = 0; int k = 0; k 0 k < s-1 k s-1 s 1 k++ k++ k {
				System.out.print(n[k] + " ");
			} {
				System.out.print(n[k] + " ");
			} System.out.print(n[k] + " ") System.out.print System.out System System.out n[k] + " " n[k] n k " " System.out.println(n[s-1]) System.out.println System.out System System.out n[s-1] n s-1 s 1 b = n[i] b n[i] n i c = i-1 c i-1 i 1 while(c >= 0 && n[c] > b){
				n[c+1] = n[c];
				c--;
			} c >= 0 && n[c] > b c >= 0 c 0 n[c] > b n[c] n c b {
				n[c+1] = n[c];
				c--;
			} n[c+1] = n[c] n[c+1] n c+1 c 1 n[c] n c c-- c n[c+1] = b n[c+1] n c+1 c 1 b for(int k = 0; k < s-1; k++){
			System.out.print(n[k] + " ") ;
		} int k = 0; int k = 0; k 0 k < s-1 k s-1 s 1 k++ k++ k {
			System.out.print(n[k] + " ") ;
		} {
			System.out.print(n[k] + " ") ;
		} System.out.print(n[k] + " ") System.out.print System.out System System.out n[k] + " " n[k] n k " " System.out.println(n[s-1]) System.out.println System.out System System.out n[s-1] n s-1 s 1 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int[] n = new int[s];
		
		for(int i= 0; i < s; i++){
			n[i] = sc.nextInt();
		}

		int b,c;

		for(int i = 1; i < s; i++){
			for(int k = 0; k < s-1; k++){
				System.out.print(n[k] + " ");
			}
			System.out.println(n[s-1]);

			b = n[i];
			c = i-1;

			while(c >= 0 && n[c] > b){
				n[c+1] = n[c];
				c--;
			}
			n[c+1] = b;
		}
		for(int k = 0; k < s-1; k++){
			System.out.print(n[k] + " ") ;
		}
		System.out.println(n[s-1]);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int[] n = new int[s];
		
		for(int i= 0; i < s; i++){
			n[i] = sc.nextInt();
		}

		int b,c;

		for(int i = 1; i < s; i++){
			for(int k = 0; k < s-1; k++){
				System.out.print(n[k] + " ");
			}
			System.out.println(n[s-1]);

			b = n[i];
			c = i-1;

			while(c >= 0 && n[c] > b){
				n[c+1] = n[c];
				c--;
			}
			n[c+1] = b;
		}
		for(int k = 0; k < s-1; k++){
			System.out.print(n[k] + " ") ;
		}
		System.out.println(n[s-1]);
	}
} Main
import java.util.Scanner;

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

		int b,c;

		for(int i = 1; i < s; i++){
			for(int k = 0; k < s-1; k++){
				System.out.print(n[k] + " ");
			}
			System.out.println(n[s-1]);

			b = n[i];
			c = i-1;

			while(c >= 0 && n[c] > b){
				n[c+1] = n[c];
				c--;
			}
			n[c+1] = b;
		}
		for(int k = 0; k < s-1; k++){
			System.out.print(n[k] + " ") ;
		}
		System.out.println(n[s-1]);
	}
}