import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int key = 0;
        int kari = 0;


        //2???????????\????????¢
        String[] input2 = br.readLine().split(" ");

        //???????????????
        int[] num = new int[Integer.parseInt(n)];

        for(int set = 0; set < num.length; set++){
        	num[set] = Integer.parseInt(input2[set]);
        }

        //???????????????????????¨???
        for(int out = 1;out  <  num.length; out++){
        	key = num[out];
        	kari = out -1;
        	//???????????\
        	for(int set = 0; set < num.length; set++){
        		buider.append(num[set]);
        		if(set != num.length -1){
        			buider.append(" ");
        		}
        	}
        	System.out.println(buider.toString());

        	//????????¢?????????
        	buider.setLength(0);

        	//????????????
        	while(kari >= 0 && num[kari] > key){
        		num[kari + 1] = num[kari];
        		kari--;
        	}

        	//while?????\???????????´???
        	num[kari + 1] = key;
        }

        //??????????????¢??¨???
    	for(int set = 0; set < num.length; set++){
    		buider.append(num[set]);
    		if(set != num.length -1){
    			buider.append(" ");
    		}
    	}
    	System.out.println(buider.toString());
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int key = 0;
        int kari = 0;


        //2???????????\????????¢
        String[] input2 = br.readLine().split(" ");

        //???????????????
        int[] num = new int[Integer.parseInt(n)];

        for(int set = 0; set < num.length; set++){
        	num[set] = Integer.parseInt(input2[set]);
        }

        //???????????????????????¨???
        for(int out = 1;out  <  num.length; out++){
        	key = num[out];
        	kari = out -1;
        	//???????????\
        	for(int set = 0; set < num.length; set++){
        		buider.append(num[set]);
        		if(set != num.length -1){
        			buider.append(" ");
        		}
        	}
        	System.out.println(buider.toString());

        	//????????¢?????????
        	buider.setLength(0);

        	//????????????
        	while(kari >= 0 && num[kari] > key){
        		num[kari + 1] = num[kari];
        		kari--;
        	}

        	//while?????\???????????´???
        	num[kari + 1] = key;
        }

        //??????????????¢??¨???
    	for(int set = 0; set < num.length; set++){
    		buider.append(num[set]);
    		if(set != num.length -1){
    			buider.append(" ");
    		}
    	}
    	System.out.println(buider.toString());
	}
} Main public void maain(){

	} maain {

	} public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int key = 0;
        int kari = 0;


        //2???????????\????????¢
        String[] input2 = br.readLine().split(" ");

        //???????????????
        int[] num = new int[Integer.parseInt(n)];

        for(int set = 0; set < num.length; set++){
        	num[set] = Integer.parseInt(input2[set]);
        }

        //???????????????????????¨???
        for(int out = 1;out  <  num.length; out++){
        	key = num[out];
        	kari = out -1;
        	//???????????\
        	for(int set = 0; set < num.length; set++){
        		buider.append(num[set]);
        		if(set != num.length -1){
        			buider.append(" ");
        		}
        	}
        	System.out.println(buider.toString());

        	//????????¢?????????
        	buider.setLength(0);

        	//????????????
        	while(kari >= 0 && num[kari] > key){
        		num[kari + 1] = num[kari];
        		kari--;
        	}

        	//while?????\???????????´???
        	num[kari + 1] = key;
        }

        //??????????????¢??¨???
    	for(int set = 0; set < num.length; set++){
    		buider.append(num[set]);
    		if(set != num.length -1){
    			buider.append(" ");
    		}
    	}
    	System.out.println(buider.toString());
	} main {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int key = 0;
        int kari = 0;


        //2???????????\????????¢
        String[] input2 = br.readLine().split(" ");

        //???????????????
        int[] num = new int[Integer.parseInt(n)];

        for(int set = 0; set < num.length; set++){
        	num[set] = Integer.parseInt(input2[set]);
        }

        //???????????????????????¨???
        for(int out = 1;out  <  num.length; out++){
        	key = num[out];
        	kari = out -1;
        	//???????????\
        	for(int set = 0; set < num.length; set++){
        		buider.append(num[set]);
        		if(set != num.length -1){
        			buider.append(" ");
        		}
        	}
        	System.out.println(buider.toString());

        	//????????¢?????????
        	buider.setLength(0);

        	//????????????
        	while(kari >= 0 && num[kari] > key){
        		num[kari + 1] = num[kari];
        		kari--;
        	}

        	//while?????\???????????´???
        	num[kari + 1] = key;
        }

        //??????????????¢??¨???
    	for(int set = 0; set < num.length; set++){
    		buider.append(num[set]);
    		if(set != num.length -1){
    			buider.append(" ");
    		}
    	}
    	System.out.println(buider.toString());
	} StringBuilder buider = new StringBuilder(); buider new StringBuilder() BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String n = br.readLine(); n br.readLine() br.readLine br int key = 0; key 0 int kari = 0; kari 0 String[] input2 = br.readLine().split(" "); input2 br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] num = new int[Integer.parseInt(n)]; num new int[Integer.parseInt(n)] Integer.parseInt(n) Integer.parseInt Integer n for(int set = 0; set < num.length; set++){
        	num[set] = Integer.parseInt(input2[set]);
        } int set = 0; int set = 0; set 0 set < num.length set num.length num num.length set++ set++ set {
        	num[set] = Integer.parseInt(input2[set]);
        } {
        	num[set] = Integer.parseInt(input2[set]);
        } num[set] = Integer.parseInt(input2[set]) num[set] num set Integer.parseInt(input2[set]) Integer.parseInt Integer input2[set] input2 set for(int out = 1;out  <  num.length; out++){
        	key = num[out];
        	kari = out -1;
        	//???????????\
        	for(int set = 0; set < num.length; set++){
        		buider.append(num[set]);
        		if(set != num.length -1){
        			buider.append(" ");
        		}
        	}
        	System.out.println(buider.toString());

        	//????????¢?????????
        	buider.setLength(0);

        	//????????????
        	while(kari >= 0 && num[kari] > key){
        		num[kari + 1] = num[kari];
        		kari--;
        	}

        	//while?????\???????????´???
        	num[kari + 1] = key;
        } int out = 1; int out = 1; out 1 out  <  num.length out num.length num num.length out++ out++ out {
        	key = num[out];
        	kari = out -1;
        	//???????????\
        	for(int set = 0; set < num.length; set++){
        		buider.append(num[set]);
        		if(set != num.length -1){
        			buider.append(" ");
        		}
        	}
        	System.out.println(buider.toString());

        	//????????¢?????????
        	buider.setLength(0);

        	//????????????
        	while(kari >= 0 && num[kari] > key){
        		num[kari + 1] = num[kari];
        		kari--;
        	}

        	//while?????\???????????´???
        	num[kari + 1] = key;
        } {
        	key = num[out];
        	kari = out -1;
        	//???????????\
        	for(int set = 0; set < num.length; set++){
        		buider.append(num[set]);
        		if(set != num.length -1){
        			buider.append(" ");
        		}
        	}
        	System.out.println(buider.toString());

        	//????????¢?????????
        	buider.setLength(0);

        	//????????????
        	while(kari >= 0 && num[kari] > key){
        		num[kari + 1] = num[kari];
        		kari--;
        	}

        	//while?????\???????????´???
        	num[kari + 1] = key;
        } key = num[out] key num[out] num out kari = out -1 kari out -1 out 1 for(int set = 0; set < num.length; set++){
        		buider.append(num[set]);
        		if(set != num.length -1){
        			buider.append(" ");
        		}
        	} int set = 0; int set = 0; set 0 set < num.length set num.length num num.length set++ set++ set {
        		buider.append(num[set]);
        		if(set != num.length -1){
        			buider.append(" ");
        		}
        	} {
        		buider.append(num[set]);
        		if(set != num.length -1){
        			buider.append(" ");
        		}
        	} buider.append(num[set]) buider.append buider num[set] num set if(set != num.length -1){
        			buider.append(" ");
        		} set != num.length -1 set num.length -1 num.length num num.length 1 {
        			buider.append(" ");
        		} buider.append(" ") buider.append buider " " System.out.println(buider.toString()) System.out.println System.out System System.out buider.toString() buider.toString buider buider.setLength(0) buider.setLength buider 0 while(kari >= 0 && num[kari] > key){
        		num[kari + 1] = num[kari];
        		kari--;
        	} kari >= 0 && num[kari] > key kari >= 0 kari 0 num[kari] > key num[kari] num kari key {
        		num[kari + 1] = num[kari];
        		kari--;
        	} num[kari + 1] = num[kari] num[kari + 1] num kari + 1 kari 1 num[kari] num kari kari-- kari num[kari + 1] = key num[kari + 1] num kari + 1 kari 1 key for(int set = 0; set < num.length; set++){
    		buider.append(num[set]);
    		if(set != num.length -1){
    			buider.append(" ");
    		}
    	} int set = 0; int set = 0; set 0 set < num.length set num.length num num.length set++ set++ set {
    		buider.append(num[set]);
    		if(set != num.length -1){
    			buider.append(" ");
    		}
    	} {
    		buider.append(num[set]);
    		if(set != num.length -1){
    			buider.append(" ");
    		}
    	} buider.append(num[set]) buider.append buider num[set] num set if(set != num.length -1){
    			buider.append(" ");
    		} set != num.length -1 set num.length -1 num.length num num.length 1 {
    			buider.append(" ");
    		} buider.append(" ") buider.append buider " " System.out.println(buider.toString()) System.out.println System.out System System.out buider.toString() buider.toString buider String[] args args public class Main {
	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int key = 0;
        int kari = 0;


        //2???????????\????????¢
        String[] input2 = br.readLine().split(" ");

        //???????????????
        int[] num = new int[Integer.parseInt(n)];

        for(int set = 0; set < num.length; set++){
        	num[set] = Integer.parseInt(input2[set]);
        }

        //???????????????????????¨???
        for(int out = 1;out  <  num.length; out++){
        	key = num[out];
        	kari = out -1;
        	//???????????\
        	for(int set = 0; set < num.length; set++){
        		buider.append(num[set]);
        		if(set != num.length -1){
        			buider.append(" ");
        		}
        	}
        	System.out.println(buider.toString());

        	//????????¢?????????
        	buider.setLength(0);

        	//????????????
        	while(kari >= 0 && num[kari] > key){
        		num[kari + 1] = num[kari];
        		kari--;
        	}

        	//while?????\???????????´???
        	num[kari + 1] = key;
        }

        //??????????????¢??¨???
    	for(int set = 0; set < num.length; set++){
    		buider.append(num[set]);
    		if(set != num.length -1){
    			buider.append(" ");
    		}
    	}
    	System.out.println(buider.toString());
	}
} public class Main {
	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int key = 0;
        int kari = 0;


        //2???????????\????????¢
        String[] input2 = br.readLine().split(" ");

        //???????????????
        int[] num = new int[Integer.parseInt(n)];

        for(int set = 0; set < num.length; set++){
        	num[set] = Integer.parseInt(input2[set]);
        }

        //???????????????????????¨???
        for(int out = 1;out  <  num.length; out++){
        	key = num[out];
        	kari = out -1;
        	//???????????\
        	for(int set = 0; set < num.length; set++){
        		buider.append(num[set]);
        		if(set != num.length -1){
        			buider.append(" ");
        		}
        	}
        	System.out.println(buider.toString());

        	//????????¢?????????
        	buider.setLength(0);

        	//????????????
        	while(kari >= 0 && num[kari] > key){
        		num[kari + 1] = num[kari];
        		kari--;
        	}

        	//while?????\???????????´???
        	num[kari + 1] = key;
        }

        //??????????????¢??¨???
    	for(int set = 0; set < num.length; set++){
    		buider.append(num[set]);
    		if(set != num.length -1){
    			buider.append(" ");
    		}
    	}
    	System.out.println(buider.toString());
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int key = 0;
        int kari = 0;


        //2???????????\????????¢
        String[] input2 = br.readLine().split(" ");

        //???????????????
        int[] num = new int[Integer.parseInt(n)];

        for(int set = 0; set < num.length; set++){
        	num[set] = Integer.parseInt(input2[set]);
        }

        //???????????????????????¨???
        for(int out = 1;out  <  num.length; out++){
        	key = num[out];
        	kari = out -1;
        	//???????????\
        	for(int set = 0; set < num.length; set++){
        		buider.append(num[set]);
        		if(set != num.length -1){
        			buider.append(" ");
        		}
        	}
        	System.out.println(buider.toString());

        	//????????¢?????????
        	buider.setLength(0);

        	//????????????
        	while(kari >= 0 && num[kari] > key){
        		num[kari + 1] = num[kari];
        		kari--;
        	}

        	//while?????\???????????´???
        	num[kari + 1] = key;
        }

        //??????????????¢??¨???
    	for(int set = 0; set < num.length; set++){
    		buider.append(num[set]);
    		if(set != num.length -1){
    			buider.append(" ");
    		}
    	}
    	System.out.println(buider.toString());
	}
}