import java.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main{
	public static void main(String [] args)throws Exception{
		BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in));
		int j=0;
		int N = Integer.parseInt(Reader.readLine());
		String A[] = Reader.readLine().split(" ",0);
		for(int i=0;i<=N-1;i++){
			String v = A[i];
			j = i-1;
			while (j>=0 && Integer.parseInt(A[j])>Integer.parseInt(v)){
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			System.out.println(String.join(" ",A));
		}
	}
} import java.util.*; util.* java import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main{
	public static void main(String [] args)throws Exception{
		BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in));
		int j=0;
		int N = Integer.parseInt(Reader.readLine());
		String A[] = Reader.readLine().split(" ",0);
		for(int i=0;i<=N-1;i++){
			String v = A[i];
			j = i-1;
			while (j>=0 && Integer.parseInt(A[j])>Integer.parseInt(v)){
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			System.out.println(String.join(" ",A));
		}
	}
} Main public static void main(String [] args)throws Exception{
		BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in));
		int j=0;
		int N = Integer.parseInt(Reader.readLine());
		String A[] = Reader.readLine().split(" ",0);
		for(int i=0;i<=N-1;i++){
			String v = A[i];
			j = i-1;
			while (j>=0 && Integer.parseInt(A[j])>Integer.parseInt(v)){
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			System.out.println(String.join(" ",A));
		}
	} main {
		BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in));
		int j=0;
		int N = Integer.parseInt(Reader.readLine());
		String A[] = Reader.readLine().split(" ",0);
		for(int i=0;i<=N-1;i++){
			String v = A[i];
			j = i-1;
			while (j>=0 && Integer.parseInt(A[j])>Integer.parseInt(v)){
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			System.out.println(String.join(" ",A));
		}
	} BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in)); Reader new BufferedReader (new InputStreamReader(System.in)) int j=0; j 0 int N = Integer.parseInt(Reader.readLine()); N Integer.parseInt(Reader.readLine()) Integer.parseInt Integer Reader.readLine() Reader.readLine Reader String A[] = Reader.readLine().split(" ",0); A Reader.readLine().split(" ",0) Reader.readLine().split Reader.readLine() Reader.readLine Reader " " 0 for(int i=0;i<=N-1;i++){
			String v = A[i];
			j = i-1;
			while (j>=0 && Integer.parseInt(A[j])>Integer.parseInt(v)){
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			System.out.println(String.join(" ",A));
		} int i=0; int i=0; i 0 i<=N-1 i N-1 N 1 i++ i++ i {
			String v = A[i];
			j = i-1;
			while (j>=0 && Integer.parseInt(A[j])>Integer.parseInt(v)){
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			System.out.println(String.join(" ",A));
		} {
			String v = A[i];
			j = i-1;
			while (j>=0 && Integer.parseInt(A[j])>Integer.parseInt(v)){
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			System.out.println(String.join(" ",A));
		} String v = A[i]; v A[i] A i j = i-1 j i-1 i 1 while (j>=0 && Integer.parseInt(A[j])>Integer.parseInt(v)){
				A[j+1] = A[j];
				j--;
			} j>=0 && Integer.parseInt(A[j])>Integer.parseInt(v) j>=0 j 0 Integer.parseInt(A[j])>Integer.parseInt(v) Integer.parseInt(A[j]) Integer.parseInt Integer A[j] A j Integer.parseInt(v) Integer.parseInt Integer 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 System.out.println(String.join(" ",A)) System.out.println System.out System System.out String.join(" ",A) String.join String " " A String [] args args public class Main{
	public static void main(String [] args)throws Exception{
		BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in));
		int j=0;
		int N = Integer.parseInt(Reader.readLine());
		String A[] = Reader.readLine().split(" ",0);
		for(int i=0;i<=N-1;i++){
			String v = A[i];
			j = i-1;
			while (j>=0 && Integer.parseInt(A[j])>Integer.parseInt(v)){
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			System.out.println(String.join(" ",A));
		}
	}
} public class Main{
	public static void main(String [] args)throws Exception{
		BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in));
		int j=0;
		int N = Integer.parseInt(Reader.readLine());
		String A[] = Reader.readLine().split(" ",0);
		for(int i=0;i<=N-1;i++){
			String v = A[i];
			j = i-1;
			while (j>=0 && Integer.parseInt(A[j])>Integer.parseInt(v)){
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			System.out.println(String.join(" ",A));
		}
	}
} Main
import java.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main{
	public static void main(String [] args)throws Exception{
		BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in));
		int j=0;
		int N = Integer.parseInt(Reader.readLine());
		String A[] = Reader.readLine().split(" ",0);
		for(int i=0;i<=N-1;i++){
			String v = A[i];
			j = i-1;
			while (j>=0 && Integer.parseInt(A[j])>Integer.parseInt(v)){
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			System.out.println(String.join(" ",A));
		}
	}
}