import java.util.*;

class Main{
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		int c,d = 0;
		int[] array = new int[a];
		
		for(int i=0;i<a;i++){
			array[i] = sc.nextInt();
		}
		output(array);
		
		for(int b=1;b<array.length;b++){
			c = array[b];
			d = b-1;
			while(d>=0 && array[d] > c){
				array[d+1] = array[d];
				d--;
			}
			array[d+1] = c;
			output(array);
		}
	}
		
		static void output(int[] a){
			for (int i=0; i<a.length; i++) {
				System.out.print(a[i]);
				if(i<a.length-1){
					System.out.print(" ");
				}else{
					System.out.println();
				}
			}
		}
} import java.util.*; util.* java class Main{
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		int c,d = 0;
		int[] array = new int[a];
		
		for(int i=0;i<a;i++){
			array[i] = sc.nextInt();
		}
		output(array);
		
		for(int b=1;b<array.length;b++){
			c = array[b];
			d = b-1;
			while(d>=0 && array[d] > c){
				array[d+1] = array[d];
				d--;
			}
			array[d+1] = c;
			output(array);
		}
	}
		
		static void output(int[] a){
			for (int i=0; i<a.length; i++) {
				System.out.print(a[i]);
				if(i<a.length-1){
					System.out.print(" ");
				}else{
					System.out.println();
				}
			}
		}
} Main public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		int c,d = 0;
		int[] array = new int[a];
		
		for(int i=0;i<a;i++){
			array[i] = sc.nextInt();
		}
		output(array);
		
		for(int b=1;b<array.length;b++){
			c = array[b];
			d = b-1;
			while(d>=0 && array[d] > c){
				array[d+1] = array[d];
				d--;
			}
			array[d+1] = c;
			output(array);
		}
	} main {
		
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		int c,d = 0;
		int[] array = new int[a];
		
		for(int i=0;i<a;i++){
			array[i] = sc.nextInt();
		}
		output(array);
		
		for(int b=1;b<array.length;b++){
			c = array[b];
			d = b-1;
			while(d>=0 && array[d] > c){
				array[d+1] = array[d];
				d--;
			}
			array[d+1] = c;
			output(array);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int c c d = 0; d 0 int[] array = new int[a]; array new int[a] a for(int i=0;i<a;i++){
			array[i] = sc.nextInt();
		} int i=0; int i=0; i 0 i<a i a i++ i++ i {
			array[i] = sc.nextInt();
		} {
			array[i] = sc.nextInt();
		} array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc output(array) output array for(int b=1;b<array.length;b++){
			c = array[b];
			d = b-1;
			while(d>=0 && array[d] > c){
				array[d+1] = array[d];
				d--;
			}
			array[d+1] = c;
			output(array);
		} int b=1; int b=1; b 1 b<array.length b array.length array array.length b++ b++ b {
			c = array[b];
			d = b-1;
			while(d>=0 && array[d] > c){
				array[d+1] = array[d];
				d--;
			}
			array[d+1] = c;
			output(array);
		} {
			c = array[b];
			d = b-1;
			while(d>=0 && array[d] > c){
				array[d+1] = array[d];
				d--;
			}
			array[d+1] = c;
			output(array);
		} c = array[b] c array[b] array b d = b-1 d b-1 b 1 while(d>=0 && array[d] > c){
				array[d+1] = array[d];
				d--;
			} d>=0 && array[d] > c d>=0 d 0 array[d] > c array[d] array d c {
				array[d+1] = array[d];
				d--;
			} array[d+1] = array[d] array[d+1] array d+1 d 1 array[d] array d d-- d array[d+1] = c array[d+1] array d+1 d 1 c output(array) output array String[] args args static void output(int[] a){
			for (int i=0; i<a.length; i++) {
				System.out.print(a[i]);
				if(i<a.length-1){
					System.out.print(" ");
				}else{
					System.out.println();
				}
			}
		} output {
			for (int i=0; i<a.length; i++) {
				System.out.print(a[i]);
				if(i<a.length-1){
					System.out.print(" ");
				}else{
					System.out.println();
				}
			}
		} for (int i=0; i<a.length; i++) {
				System.out.print(a[i]);
				if(i<a.length-1){
					System.out.print(" ");
				}else{
					System.out.println();
				}
			} 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(" ");
				}else{
					System.out.println();
				}
			} {
				System.out.print(a[i]);
				if(i<a.length-1){
					System.out.print(" ");
				}else{
					System.out.println();
				}
			} 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(" ");
				}else{
					System.out.println();
				} i<a.length-1 i a.length-1 a.length a a.length 1 {
					System.out.print(" ");
				} System.out.print(" ") System.out.print System.out System System.out " " {
					System.out.println();
				} 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 sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		int c,d = 0;
		int[] array = new int[a];
		
		for(int i=0;i<a;i++){
			array[i] = sc.nextInt();
		}
		output(array);
		
		for(int b=1;b<array.length;b++){
			c = array[b];
			d = b-1;
			while(d>=0 && array[d] > c){
				array[d+1] = array[d];
				d--;
			}
			array[d+1] = c;
			output(array);
		}
	}
		
		static void output(int[] a){
			for (int i=0; i<a.length; i++) {
				System.out.print(a[i]);
				if(i<a.length-1){
					System.out.print(" ");
				}else{
					System.out.println();
				}
			}
		}
}
