import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
 
public class Main {
	private static final String CRLF = System.lineSeparator();
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int N = Integer.parseInt(br.readLine());
        int[] A = new int[N];
        StringBuilder sb = new StringBuilder();
        int i=0;
        for(String s: br.readLine().split(" ")){
        	A[i++] = Integer.parseInt(s);
        }
        intArrayToString(A,sb);
        for(i=1; i<N; i++){
        	int v = A[i];
        	int j = i-1;
        	while(j>=0 && A[j]>v) {
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;
            intArrayToString(A,sb);	
        }
        out.print(sb.toString());
        out.flush();
    }
	private void intArrayToString(int[] a, StringBuilder sb) {
		for(int i=0; i<a.length; i++) {
			if (i>0)
				sb.append(" ");
			sb.append(a[i]);
		}
        sb.append(CRLF);
	}
	
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io public class Main {
	private static final String CRLF = System.lineSeparator();
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int N = Integer.parseInt(br.readLine());
        int[] A = new int[N];
        StringBuilder sb = new StringBuilder();
        int i=0;
        for(String s: br.readLine().split(" ")){
        	A[i++] = Integer.parseInt(s);
        }
        intArrayToString(A,sb);
        for(i=1; i<N; i++){
        	int v = A[i];
        	int j = i-1;
        	while(j>=0 && A[j]>v) {
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;
            intArrayToString(A,sb);	
        }
        out.print(sb.toString());
        out.flush();
    }
	private void intArrayToString(int[] a, StringBuilder sb) {
		for(int i=0; i<a.length; i++) {
			if (i>0)
				sb.append(" ");
			sb.append(a[i]);
		}
        sb.append(CRLF);
	}
	
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
} Main private static final String CRLF = System.lineSeparator(); CRLF System.lineSeparator() System.lineSeparator System public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int N = Integer.parseInt(br.readLine());
        int[] A = new int[N];
        StringBuilder sb = new StringBuilder();
        int i=0;
        for(String s: br.readLine().split(" ")){
        	A[i++] = Integer.parseInt(s);
        }
        intArrayToString(A,sb);
        for(i=1; i<N; i++){
        	int v = A[i];
        	int j = i-1;
        	while(j>=0 && A[j]>v) {
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;
            intArrayToString(A,sb);	
        }
        out.print(sb.toString());
        out.flush();
    } exec {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int N = Integer.parseInt(br.readLine());
        int[] A = new int[N];
        StringBuilder sb = new StringBuilder();
        int i=0;
        for(String s: br.readLine().split(" ")){
        	A[i++] = Integer.parseInt(s);
        }
        intArrayToString(A,sb);
        for(i=1; i<N; i++){
        	int v = A[i];
        	int j = i-1;
        	while(j>=0 && A[j]>v) {
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;
            intArrayToString(A,sb);	
        }
        out.print(sb.toString());
        out.flush();
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) int N = Integer.parseInt(br.readLine()); N Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[] A = new int[N]; A new int[N] N StringBuilder sb = new StringBuilder(); sb new StringBuilder() int i=0; i 0 for(String s: br.readLine().split(" ")){
        	A[i++] = Integer.parseInt(s);
        } String s br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " {
        	A[i++] = Integer.parseInt(s);
        } {
        	A[i++] = Integer.parseInt(s);
        } A[i++] = Integer.parseInt(s) A[i++] A i++ i Integer.parseInt(s) Integer.parseInt Integer s intArrayToString(A,sb) intArrayToString A sb for(i=1; i<N; i++){
        	int v = A[i];
        	int j = i-1;
        	while(j>=0 && A[j]>v) {
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;
            intArrayToString(A,sb);	
        } i=1; i=1 i 1 i<N i N i++ i++ i {
        	int v = A[i];
        	int j = i-1;
        	while(j>=0 && A[j]>v) {
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;
            intArrayToString(A,sb);	
        } {
        	int v = A[i];
        	int j = i-1;
        	while(j>=0 && A[j]>v) {
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;
            intArrayToString(A,sb);	
        } 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 intArrayToString(A,sb) intArrayToString A sb out.print(sb.toString()) out.print out sb.toString() sb.toString sb out.flush() out.flush out private void intArrayToString(int[] a, StringBuilder sb) {
		for(int i=0; i<a.length; i++) {
			if (i>0)
				sb.append(" ");
			sb.append(a[i]);
		}
        sb.append(CRLF);
	} intArrayToString {
		for(int i=0; i<a.length; i++) {
			if (i>0)
				sb.append(" ");
			sb.append(a[i]);
		}
        sb.append(CRLF);
	} for(int i=0; i<a.length; i++) {
			if (i>0)
				sb.append(" ");
			sb.append(a[i]);
		} int i=0; int i=0; i 0 i<a.length i a.length a a.length i++ i++ i {
			if (i>0)
				sb.append(" ");
			sb.append(a[i]);
		} {
			if (i>0)
				sb.append(" ");
			sb.append(a[i]);
		} if (i>0)
				sb.append(" "); i>0 i 0 sb.append(" ") sb.append sb " " sb.append(a[i]) sb.append sb a[i] a i sb.append(CRLF) sb.append sb CRLF int[] a a StringBuilder sb sb public static void main(String[] args) throws IOException {
        new Main().exec();
    } main {
        new Main().exec();
    } new Main().exec() new Main().exec new Main() String[] args args public class Main {
	private static final String CRLF = System.lineSeparator();
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int N = Integer.parseInt(br.readLine());
        int[] A = new int[N];
        StringBuilder sb = new StringBuilder();
        int i=0;
        for(String s: br.readLine().split(" ")){
        	A[i++] = Integer.parseInt(s);
        }
        intArrayToString(A,sb);
        for(i=1; i<N; i++){
        	int v = A[i];
        	int j = i-1;
        	while(j>=0 && A[j]>v) {
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;
            intArrayToString(A,sb);	
        }
        out.print(sb.toString());
        out.flush();
    }
	private void intArrayToString(int[] a, StringBuilder sb) {
		for(int i=0; i<a.length; i++) {
			if (i>0)
				sb.append(" ");
			sb.append(a[i]);
		}
        sb.append(CRLF);
	}
	
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
} public class Main {
	private static final String CRLF = System.lineSeparator();
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int N = Integer.parseInt(br.readLine());
        int[] A = new int[N];
        StringBuilder sb = new StringBuilder();
        int i=0;
        for(String s: br.readLine().split(" ")){
        	A[i++] = Integer.parseInt(s);
        }
        intArrayToString(A,sb);
        for(i=1; i<N; i++){
        	int v = A[i];
        	int j = i-1;
        	while(j>=0 && A[j]>v) {
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;
            intArrayToString(A,sb);	
        }
        out.print(sb.toString());
        out.flush();
    }
	private void intArrayToString(int[] a, StringBuilder sb) {
		for(int i=0; i<a.length; i++) {
			if (i>0)
				sb.append(" ");
			sb.append(a[i]);
		}
        sb.append(CRLF);
	}
	
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
 
public class Main {
	private static final String CRLF = System.lineSeparator();
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int N = Integer.parseInt(br.readLine());
        int[] A = new int[N];
        StringBuilder sb = new StringBuilder();
        int i=0;
        for(String s: br.readLine().split(" ")){
        	A[i++] = Integer.parseInt(s);
        }
        intArrayToString(A,sb);
        for(i=1; i<N; i++){
        	int v = A[i];
        	int j = i-1;
        	while(j>=0 && A[j]>v) {
        		A[j+1] = A[j];
        		j--;
        	}
        	A[j+1] = v;
            intArrayToString(A,sb);	
        }
        out.print(sb.toString());
        out.flush();
    }
	private void intArrayToString(int[] a, StringBuilder sb) {
		for(int i=0; i<a.length; i++) {
			if (i>0)
				sb.append(" ");
			sb.append(a[i]);
		}
        sb.append(CRLF);
	}
	
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
}