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

public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {
		//????????????????????????
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		//?????°
		int num = Integer.parseInt(bf.readLine());
		
		//??????????´?
		int[] array = new int[num];
		
		//?????????
		String[] arrayString = bf.readLine().split(" ");
		
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(arrayString[i]);
		}
		
		insertionSort(array,num);
		
	}
	
	private static void insertionSort(int[] array, int num){
		for(int i=0;i<num;i++){
			int var = array[i];
			int j=i-1;
			
			while(j>=0 && array[j]>var){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=var;
			showLog(array);
		}
	}
	
	private static void showLog(int[] array){
		for(int i=0;i<array.length;i++){
			System.out.printf("%d",array[i]);
			if(i!=array.length-1){
				System.out.printf(" ");
			}
		}
		System.out.println();
	}
} 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 static void main(String[] args) throws NumberFormatException, IOException {
		//????????????????????????
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		//?????°
		int num = Integer.parseInt(bf.readLine());
		
		//??????????´?
		int[] array = new int[num];
		
		//?????????
		String[] arrayString = bf.readLine().split(" ");
		
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(arrayString[i]);
		}
		
		insertionSort(array,num);
		
	}
	
	private static void insertionSort(int[] array, int num){
		for(int i=0;i<num;i++){
			int var = array[i];
			int j=i-1;
			
			while(j>=0 && array[j]>var){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=var;
			showLog(array);
		}
	}
	
	private static void showLog(int[] array){
		for(int i=0;i<array.length;i++){
			System.out.printf("%d",array[i]);
			if(i!=array.length-1){
				System.out.printf(" ");
			}
		}
		System.out.println();
	}
} Main public static void main(String[] args) throws NumberFormatException, IOException {
		//????????????????????????
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		//?????°
		int num = Integer.parseInt(bf.readLine());
		
		//??????????´?
		int[] array = new int[num];
		
		//?????????
		String[] arrayString = bf.readLine().split(" ");
		
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(arrayString[i]);
		}
		
		insertionSort(array,num);
		
	} main {
		//????????????????????????
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		//?????°
		int num = Integer.parseInt(bf.readLine());
		
		//??????????´?
		int[] array = new int[num];
		
		//?????????
		String[] arrayString = bf.readLine().split(" ");
		
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(arrayString[i]);
		}
		
		insertionSort(array,num);
		
	} BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); bf new BufferedReader(new InputStreamReader(System.in)) String line; line int num = Integer.parseInt(bf.readLine()); num Integer.parseInt(bf.readLine()) Integer.parseInt Integer bf.readLine() bf.readLine bf int[] array = new int[num]; array new int[num] num String[] arrayString = bf.readLine().split(" "); arrayString bf.readLine().split(" ") bf.readLine().split bf.readLine() bf.readLine bf " " for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(arrayString[i]);
		} int i=0; int i=0; i 0 i<num i num i++ i++ i {
			array[i]=Integer.parseInt(arrayString[i]);
		} {
			array[i]=Integer.parseInt(arrayString[i]);
		} array[i]=Integer.parseInt(arrayString[i]) array[i] array i Integer.parseInt(arrayString[i]) Integer.parseInt Integer arrayString[i] arrayString i insertionSort(array,num) insertionSort array num String[] args args private static void insertionSort(int[] array, int num){
		for(int i=0;i<num;i++){
			int var = array[i];
			int j=i-1;
			
			while(j>=0 && array[j]>var){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=var;
			showLog(array);
		}
	} insertionSort {
		for(int i=0;i<num;i++){
			int var = array[i];
			int j=i-1;
			
			while(j>=0 && array[j]>var){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=var;
			showLog(array);
		}
	} for(int i=0;i<num;i++){
			int var = array[i];
			int j=i-1;
			
			while(j>=0 && array[j]>var){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=var;
			showLog(array);
		} int i=0; int i=0; i 0 i<num i num i++ i++ i {
			int var = array[i];
			int j=i-1;
			
			while(j>=0 && array[j]>var){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=var;
			showLog(array);
		} {
			int var = array[i];
			int j=i-1;
			
			while(j>=0 && array[j]>var){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=var;
			showLog(array);
		} int var = array[i]; var array[i] array i int j=i-1; j i-1 i 1 while(j>=0 && array[j]>var){
				array[j+1]=array[j];
				j--;
			} j>=0 && array[j]>var j>=0 j 0 array[j]>var array[j] array j var {
				array[j+1]=array[j];
				j--;
			} array[j+1]=array[j] array[j+1] array j+1 j 1 array[j] array j j-- j array[j+1]=var array[j+1] array j+1 j 1 var showLog(array) showLog array int[] array array int num num private static void showLog(int[] array){
		for(int i=0;i<array.length;i++){
			System.out.printf("%d",array[i]);
			if(i!=array.length-1){
				System.out.printf(" ");
			}
		}
		System.out.println();
	} showLog {
		for(int i=0;i<array.length;i++){
			System.out.printf("%d",array[i]);
			if(i!=array.length-1){
				System.out.printf(" ");
			}
		}
		System.out.println();
	} for(int i=0;i<array.length;i++){
			System.out.printf("%d",array[i]);
			if(i!=array.length-1){
				System.out.printf(" ");
			}
		} int i=0; int i=0; i 0 i<array.length i array.length array array.length i++ i++ i {
			System.out.printf("%d",array[i]);
			if(i!=array.length-1){
				System.out.printf(" ");
			}
		} {
			System.out.printf("%d",array[i]);
			if(i!=array.length-1){
				System.out.printf(" ");
			}
		} System.out.printf("%d",array[i]) System.out.printf System.out System System.out "%d" array[i] array i if(i!=array.length-1){
				System.out.printf(" ");
			} i!=array.length-1 i array.length-1 array.length array array.length 1 {
				System.out.printf(" ");
			} System.out.printf(" ") System.out.printf System.out System System.out " " System.out.println() System.out.println System.out System System.out int[] array array public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {
		//????????????????????????
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		//?????°
		int num = Integer.parseInt(bf.readLine());
		
		//??????????´?
		int[] array = new int[num];
		
		//?????????
		String[] arrayString = bf.readLine().split(" ");
		
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(arrayString[i]);
		}
		
		insertionSort(array,num);
		
	}
	
	private static void insertionSort(int[] array, int num){
		for(int i=0;i<num;i++){
			int var = array[i];
			int j=i-1;
			
			while(j>=0 && array[j]>var){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=var;
			showLog(array);
		}
	}
	
	private static void showLog(int[] array){
		for(int i=0;i<array.length;i++){
			System.out.printf("%d",array[i]);
			if(i!=array.length-1){
				System.out.printf(" ");
			}
		}
		System.out.println();
	}
} public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {
		//????????????????????????
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		//?????°
		int num = Integer.parseInt(bf.readLine());
		
		//??????????´?
		int[] array = new int[num];
		
		//?????????
		String[] arrayString = bf.readLine().split(" ");
		
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(arrayString[i]);
		}
		
		insertionSort(array,num);
		
	}
	
	private static void insertionSort(int[] array, int num){
		for(int i=0;i<num;i++){
			int var = array[i];
			int j=i-1;
			
			while(j>=0 && array[j]>var){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=var;
			showLog(array);
		}
	}
	
	private static void showLog(int[] array){
		for(int i=0;i<array.length;i++){
			System.out.printf("%d",array[i]);
			if(i!=array.length-1){
				System.out.printf(" ");
			}
		}
		System.out.println();
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {
		//????????????????????????
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		//?????°
		int num = Integer.parseInt(bf.readLine());
		
		//??????????´?
		int[] array = new int[num];
		
		//?????????
		String[] arrayString = bf.readLine().split(" ");
		
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(arrayString[i]);
		}
		
		insertionSort(array,num);
		
	}
	
	private static void insertionSort(int[] array, int num){
		for(int i=0;i<num;i++){
			int var = array[i];
			int j=i-1;
			
			while(j>=0 && array[j]>var){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=var;
			showLog(array);
		}
	}
	
	private static void showLog(int[] array){
		for(int i=0;i<array.length;i++){
			System.out.printf("%d",array[i]);
			if(i!=array.length-1){
				System.out.printf(" ");
			}
		}
		System.out.println();
	}
}