import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.useDelimiter(System.getProperty("line.separator"));
        int n = sc.nextInt();
        String data = sc.next();

        //String???Int????????????
        String[] datas = data.split(" ");
        int[] A = new int[n];
        for (int i = 0; i < A.length; i++) {
			A[i] = Integer.parseInt(datas[i]);
		}

        //disp
    	disp(A);

        for (int i = 1; i < n; i++) {
        	//ex. 5,3 = 3
        	int v = A[i];
        	//ex. 5,3 = 5
        	int j = i -1;

        	//              5  > 3
        	while(j>=0 && A[j] > v){
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;

        	//disp
        	disp(A);


		}
	}

	private static void disp(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.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.useDelimiter(System.getProperty("line.separator"));
        int n = sc.nextInt();
        String data = sc.next();

        //String???Int????????????
        String[] datas = data.split(" ");
        int[] A = new int[n];
        for (int i = 0; i < A.length; i++) {
			A[i] = Integer.parseInt(datas[i]);
		}

        //disp
    	disp(A);

        for (int i = 1; i < n; i++) {
        	//ex. 5,3 = 3
        	int v = A[i];
        	//ex. 5,3 = 5
        	int j = i -1;

        	//              5  > 3
        	while(j>=0 && A[j] > v){
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;

        	//disp
        	disp(A);


		}
	}

	private static void disp(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();
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.useDelimiter(System.getProperty("line.separator"));
        int n = sc.nextInt();
        String data = sc.next();

        //String???Int????????????
        String[] datas = data.split(" ");
        int[] A = new int[n];
        for (int i = 0; i < A.length; i++) {
			A[i] = Integer.parseInt(datas[i]);
		}

        //disp
    	disp(A);

        for (int i = 1; i < n; i++) {
        	//ex. 5,3 = 3
        	int v = A[i];
        	//ex. 5,3 = 5
        	int j = i -1;

        	//              5  > 3
        	while(j>=0 && A[j] > v){
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;

        	//disp
        	disp(A);


		}
	} main {
		Scanner sc = new Scanner(System.in);
		sc.useDelimiter(System.getProperty("line.separator"));
        int n = sc.nextInt();
        String data = sc.next();

        //String???Int????????????
        String[] datas = data.split(" ");
        int[] A = new int[n];
        for (int i = 0; i < A.length; i++) {
			A[i] = Integer.parseInt(datas[i]);
		}

        //disp
    	disp(A);

        for (int i = 1; i < n; i++) {
        	//ex. 5,3 = 3
        	int v = A[i];
        	//ex. 5,3 = 5
        	int j = i -1;

        	//              5  > 3
        	while(j>=0 && A[j] > v){
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;

        	//disp
        	disp(A);


		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) sc.useDelimiter(System.getProperty("line.separator")) sc.useDelimiter sc System.getProperty("line.separator") System.getProperty System "line.separator" int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String data = sc.next(); data sc.next() sc.next sc String[] datas = data.split(" "); datas data.split(" ") data.split data " " int[] A = new int[n]; A new int[n] n for (int i = 0; i < A.length; i++) {
			A[i] = Integer.parseInt(datas[i]);
		} int i = 0; int i = 0; i 0 i < A.length i A.length A A.length i++ i++ i {
			A[i] = Integer.parseInt(datas[i]);
		} {
			A[i] = Integer.parseInt(datas[i]);
		} A[i] = Integer.parseInt(datas[i]) A[i] A i Integer.parseInt(datas[i]) Integer.parseInt Integer datas[i] datas i disp(A) disp A for (int i = 1; i < n; i++) {
        	//ex. 5,3 = 3
        	int v = A[i];
        	//ex. 5,3 = 5
        	int j = i -1;

        	//              5  > 3
        	while(j>=0 && A[j] > v){
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;

        	//disp
        	disp(A);


		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
        	//ex. 5,3 = 3
        	int v = A[i];
        	//ex. 5,3 = 5
        	int j = i -1;

        	//              5  > 3
        	while(j>=0 && A[j] > v){
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;

        	//disp
        	disp(A);


		} {
        	//ex. 5,3 = 3
        	int v = A[i];
        	//ex. 5,3 = 5
        	int j = i -1;

        	//              5  > 3
        	while(j>=0 && A[j] > v){
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;

        	//disp
        	disp(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 disp(A) disp A String[] args args private static void disp(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();
	} disp {
		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 public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.useDelimiter(System.getProperty("line.separator"));
        int n = sc.nextInt();
        String data = sc.next();

        //String???Int????????????
        String[] datas = data.split(" ");
        int[] A = new int[n];
        for (int i = 0; i < A.length; i++) {
			A[i] = Integer.parseInt(datas[i]);
		}

        //disp
    	disp(A);

        for (int i = 1; i < n; i++) {
        	//ex. 5,3 = 3
        	int v = A[i];
        	//ex. 5,3 = 5
        	int j = i -1;

        	//              5  > 3
        	while(j>=0 && A[j] > v){
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;

        	//disp
        	disp(A);


		}
	}

	private static void disp(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();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.useDelimiter(System.getProperty("line.separator"));
        int n = sc.nextInt();
        String data = sc.next();

        //String???Int????????????
        String[] datas = data.split(" ");
        int[] A = new int[n];
        for (int i = 0; i < A.length; i++) {
			A[i] = Integer.parseInt(datas[i]);
		}

        //disp
    	disp(A);

        for (int i = 1; i < n; i++) {
        	//ex. 5,3 = 3
        	int v = A[i];
        	//ex. 5,3 = 5
        	int j = i -1;

        	//              5  > 3
        	while(j>=0 && A[j] > v){
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;

        	//disp
        	disp(A);


		}
	}

	private static void disp(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();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.useDelimiter(System.getProperty("line.separator"));
        int n = sc.nextInt();
        String data = sc.next();

        //String???Int????????????
        String[] datas = data.split(" ");
        int[] A = new int[n];
        for (int i = 0; i < A.length; i++) {
			A[i] = Integer.parseInt(datas[i]);
		}

        //disp
    	disp(A);

        for (int i = 1; i < n; i++) {
        	//ex. 5,3 = 3
        	int v = A[i];
        	//ex. 5,3 = 5
        	int j = i -1;

        	//              5  > 3
        	while(j>=0 && A[j] > v){
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;

        	//disp
        	disp(A);


		}
	}

	private static void disp(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();
	}

}