import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
	
	public static void InsertionSort(final int N, int[] A){
		for(int i = 0; i < N; i++){
			final int v = A[i];
			
			int j = i - 1;
			while(j >= 0 && A[j] > v){
				A[j+1] = A[j];
				j--;
			}
			
			A[j+1] = v;
			
			
			for(int k = 0; k < N; k++){
				if(k != 0){ System.out.print(" "); }
				System.out.print(A[k]);
			}
			System.out.println();
		}
	}
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		final int N = sc.nextInt();
		int[] A = new int[N];
		for(int i = 0; i < N; i++){
			A[i] = sc.nextInt();
		}
		
		InsertionSort(N, A);
		
	}
} import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main {
	
	public static void InsertionSort(final int N, int[] A){
		for(int i = 0; i < N; i++){
			final int v = A[i];
			
			int j = i - 1;
			while(j >= 0 && A[j] > v){
				A[j+1] = A[j];
				j--;
			}
			
			A[j+1] = v;
			
			
			for(int k = 0; k < N; k++){
				if(k != 0){ System.out.print(" "); }
				System.out.print(A[k]);
			}
			System.out.println();
		}
	}
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		final int N = sc.nextInt();
		int[] A = new int[N];
		for(int i = 0; i < N; i++){
			A[i] = sc.nextInt();
		}
		
		InsertionSort(N, A);
		
	}
} Main public static void InsertionSort(final int N, int[] A){
		for(int i = 0; i < N; i++){
			final int v = A[i];
			
			int j = i - 1;
			while(j >= 0 && A[j] > v){
				A[j+1] = A[j];
				j--;
			}
			
			A[j+1] = v;
			
			
			for(int k = 0; k < N; k++){
				if(k != 0){ System.out.print(" "); }
				System.out.print(A[k]);
			}
			System.out.println();
		}
	} InsertionSort {
		for(int i = 0; i < N; i++){
			final int v = A[i];
			
			int j = i - 1;
			while(j >= 0 && A[j] > v){
				A[j+1] = A[j];
				j--;
			}
			
			A[j+1] = v;
			
			
			for(int k = 0; k < N; k++){
				if(k != 0){ System.out.print(" "); }
				System.out.print(A[k]);
			}
			System.out.println();
		}
	} for(int i = 0; i < N; i++){
			final int v = A[i];
			
			int j = i - 1;
			while(j >= 0 && A[j] > v){
				A[j+1] = A[j];
				j--;
			}
			
			A[j+1] = v;
			
			
			for(int k = 0; k < N; k++){
				if(k != 0){ System.out.print(" "); }
				System.out.print(A[k]);
			}
			System.out.println();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			final int v = A[i];
			
			int j = i - 1;
			while(j >= 0 && A[j] > v){
				A[j+1] = A[j];
				j--;
			}
			
			A[j+1] = v;
			
			
			for(int k = 0; k < N; k++){
				if(k != 0){ System.out.print(" "); }
				System.out.print(A[k]);
			}
			System.out.println();
		} {
			final int v = A[i];
			
			int j = i - 1;
			while(j >= 0 && A[j] > v){
				A[j+1] = A[j];
				j--;
			}
			
			A[j+1] = v;
			
			
			for(int k = 0; k < N; k++){
				if(k != 0){ System.out.print(" "); }
				System.out.print(A[k]);
			}
			System.out.println();
		} final 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 for(int k = 0; k < N; k++){
				if(k != 0){ System.out.print(" "); }
				System.out.print(A[k]);
			} int k = 0; int k = 0; k 0 k < N k N k++ k++ k {
				if(k != 0){ System.out.print(" "); }
				System.out.print(A[k]);
			} {
				if(k != 0){ System.out.print(" "); }
				System.out.print(A[k]);
			} if(k != 0){ System.out.print(" "); } k != 0 k 0 { System.out.print(" "); } System.out.print(" ") System.out.print System.out System System.out " " System.out.print(A[k]) System.out.print System.out System System.out A[k] A k System.out.println() System.out.println System.out System System.out final int N N int[] A A public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		final int N = sc.nextInt();
		int[] A = new int[N];
		for(int i = 0; i < N; i++){
			A[i] = sc.nextInt();
		}
		
		InsertionSort(N, A);
		
	} main {
		Scanner sc = new Scanner(System.in);
		
		final int N = sc.nextInt();
		int[] A = new int[N];
		for(int i = 0; i < N; i++){
			A[i] = sc.nextInt();
		}
		
		InsertionSort(N, A);
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] A = new int[N]; A new int[N] N for(int i = 0; i < N; i++){
			A[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			A[i] = sc.nextInt();
		} {
			A[i] = sc.nextInt();
		} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc InsertionSort(N, A) InsertionSort N A String args[] args public class Main {
	
	public static void InsertionSort(final int N, int[] A){
		for(int i = 0; i < N; i++){
			final int v = A[i];
			
			int j = i - 1;
			while(j >= 0 && A[j] > v){
				A[j+1] = A[j];
				j--;
			}
			
			A[j+1] = v;
			
			
			for(int k = 0; k < N; k++){
				if(k != 0){ System.out.print(" "); }
				System.out.print(A[k]);
			}
			System.out.println();
		}
	}
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		final int N = sc.nextInt();
		int[] A = new int[N];
		for(int i = 0; i < N; i++){
			A[i] = sc.nextInt();
		}
		
		InsertionSort(N, A);
		
	}
} public class Main {
	
	public static void InsertionSort(final int N, int[] A){
		for(int i = 0; i < N; i++){
			final int v = A[i];
			
			int j = i - 1;
			while(j >= 0 && A[j] > v){
				A[j+1] = A[j];
				j--;
			}
			
			A[j+1] = v;
			
			
			for(int k = 0; k < N; k++){
				if(k != 0){ System.out.print(" "); }
				System.out.print(A[k]);
			}
			System.out.println();
		}
	}
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		final int N = sc.nextInt();
		int[] A = new int[N];
		for(int i = 0; i < N; i++){
			A[i] = sc.nextInt();
		}
		
		InsertionSort(N, A);
		
	}
} Main
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
	
	public static void InsertionSort(final int N, int[] A){
		for(int i = 0; i < N; i++){
			final int v = A[i];
			
			int j = i - 1;
			while(j >= 0 && A[j] > v){
				A[j+1] = A[j];
				j--;
			}
			
			A[j+1] = v;
			
			
			for(int k = 0; k < N; k++){
				if(k != 0){ System.out.print(" "); }
				System.out.print(A[k]);
			}
			System.out.println();
		}
	}
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		final int N = sc.nextInt();
		int[] A = new int[N];
		for(int i = 0; i < N; i++){
			A[i] = sc.nextInt();
		}
		
		InsertionSort(N, A);
		
	}
}