import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int listCount = scanner.nextInt();
		int[] listSort = new int[listCount];
		for(int i = 0; i < listCount; i++){
			listSort[i] = scanner.nextInt();
		}
		trace(listSort, listCount);
		insertionSort(listSort, listCount);
	}

	private static void insertionSort(int[] listSort, int listCount){
		for(int i = 1; i < listCount; i++){
			int v = listSort[i];
			int j = i - 1;
			while((j >= 0) && (listSort[j] > v)){
				listSort[j + 1] = listSort[j];
				j--;
			}
			listSort[j + 1] = v;
			trace(listSort, listCount);
		}
	}

	private static void trace(int[] listSort, int listCount){
		int jugeCount = listCount - 1;
		for(int i = 0; i < listCount; i++){
			System.out.print(listSort[i]);
			if(i < jugeCount){
				System.out.print(" ");
			}
		}
		System.out.print("\n");
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int listCount = scanner.nextInt();
		int[] listSort = new int[listCount];
		for(int i = 0; i < listCount; i++){
			listSort[i] = scanner.nextInt();
		}
		trace(listSort, listCount);
		insertionSort(listSort, listCount);
	}

	private static void insertionSort(int[] listSort, int listCount){
		for(int i = 1; i < listCount; i++){
			int v = listSort[i];
			int j = i - 1;
			while((j >= 0) && (listSort[j] > v)){
				listSort[j + 1] = listSort[j];
				j--;
			}
			listSort[j + 1] = v;
			trace(listSort, listCount);
		}
	}

	private static void trace(int[] listSort, int listCount){
		int jugeCount = listCount - 1;
		for(int i = 0; i < listCount; i++){
			System.out.print(listSort[i]);
			if(i < jugeCount){
				System.out.print(" ");
			}
		}
		System.out.print("\n");
	}
} Main public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int listCount = scanner.nextInt();
		int[] listSort = new int[listCount];
		for(int i = 0; i < listCount; i++){
			listSort[i] = scanner.nextInt();
		}
		trace(listSort, listCount);
		insertionSort(listSort, listCount);
	} main {
		Scanner scanner = new Scanner(System.in);
		int listCount = scanner.nextInt();
		int[] listSort = new int[listCount];
		for(int i = 0; i < listCount; i++){
			listSort[i] = scanner.nextInt();
		}
		trace(listSort, listCount);
		insertionSort(listSort, listCount);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int listCount = scanner.nextInt(); listCount scanner.nextInt() scanner.nextInt scanner int[] listSort = new int[listCount]; listSort new int[listCount] listCount for(int i = 0; i < listCount; i++){
			listSort[i] = scanner.nextInt();
		} int i = 0; int i = 0; i 0 i < listCount i listCount i++ i++ i {
			listSort[i] = scanner.nextInt();
		} {
			listSort[i] = scanner.nextInt();
		} listSort[i] = scanner.nextInt() listSort[i] listSort i scanner.nextInt() scanner.nextInt scanner trace(listSort, listCount) trace listSort listCount insertionSort(listSort, listCount) insertionSort listSort listCount String[] args args private static void insertionSort(int[] listSort, int listCount){
		for(int i = 1; i < listCount; i++){
			int v = listSort[i];
			int j = i - 1;
			while((j >= 0) && (listSort[j] > v)){
				listSort[j + 1] = listSort[j];
				j--;
			}
			listSort[j + 1] = v;
			trace(listSort, listCount);
		}
	} insertionSort {
		for(int i = 1; i < listCount; i++){
			int v = listSort[i];
			int j = i - 1;
			while((j >= 0) && (listSort[j] > v)){
				listSort[j + 1] = listSort[j];
				j--;
			}
			listSort[j + 1] = v;
			trace(listSort, listCount);
		}
	} for(int i = 1; i < listCount; i++){
			int v = listSort[i];
			int j = i - 1;
			while((j >= 0) && (listSort[j] > v)){
				listSort[j + 1] = listSort[j];
				j--;
			}
			listSort[j + 1] = v;
			trace(listSort, listCount);
		} int i = 1; int i = 1; i 1 i < listCount i listCount i++ i++ i {
			int v = listSort[i];
			int j = i - 1;
			while((j >= 0) && (listSort[j] > v)){
				listSort[j + 1] = listSort[j];
				j--;
			}
			listSort[j + 1] = v;
			trace(listSort, listCount);
		} {
			int v = listSort[i];
			int j = i - 1;
			while((j >= 0) && (listSort[j] > v)){
				listSort[j + 1] = listSort[j];
				j--;
			}
			listSort[j + 1] = v;
			trace(listSort, listCount);
		} int v = listSort[i]; v listSort[i] listSort i int j = i - 1; j i - 1 i 1 while((j >= 0) && (listSort[j] > v)){
				listSort[j + 1] = listSort[j];
				j--;
			} (j >= 0) && (listSort[j] > v) (j >= 0) j 0 (listSort[j] > v) listSort[j] listSort j v {
				listSort[j + 1] = listSort[j];
				j--;
			} listSort[j + 1] = listSort[j] listSort[j + 1] listSort j + 1 j 1 listSort[j] listSort j j-- j listSort[j + 1] = v listSort[j + 1] listSort j + 1 j 1 v trace(listSort, listCount) trace listSort listCount int[] listSort listSort int listCount listCount private static void trace(int[] listSort, int listCount){
		int jugeCount = listCount - 1;
		for(int i = 0; i < listCount; i++){
			System.out.print(listSort[i]);
			if(i < jugeCount){
				System.out.print(" ");
			}
		}
		System.out.print("\n");
	} trace {
		int jugeCount = listCount - 1;
		for(int i = 0; i < listCount; i++){
			System.out.print(listSort[i]);
			if(i < jugeCount){
				System.out.print(" ");
			}
		}
		System.out.print("\n");
	} int jugeCount = listCount - 1; jugeCount listCount - 1 listCount 1 for(int i = 0; i < listCount; i++){
			System.out.print(listSort[i]);
			if(i < jugeCount){
				System.out.print(" ");
			}
		} int i = 0; int i = 0; i 0 i < listCount i listCount i++ i++ i {
			System.out.print(listSort[i]);
			if(i < jugeCount){
				System.out.print(" ");
			}
		} {
			System.out.print(listSort[i]);
			if(i < jugeCount){
				System.out.print(" ");
			}
		} System.out.print(listSort[i]) System.out.print System.out System System.out listSort[i] listSort i if(i < jugeCount){
				System.out.print(" ");
			} i < jugeCount i jugeCount {
				System.out.print(" ");
			} System.out.print(" ") System.out.print System.out System System.out " " System.out.print("\n") System.out.print System.out System System.out "\n" int[] listSort listSort int listCount listCount public class Main {
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int listCount = scanner.nextInt();
		int[] listSort = new int[listCount];
		for(int i = 0; i < listCount; i++){
			listSort[i] = scanner.nextInt();
		}
		trace(listSort, listCount);
		insertionSort(listSort, listCount);
	}

	private static void insertionSort(int[] listSort, int listCount){
		for(int i = 1; i < listCount; i++){
			int v = listSort[i];
			int j = i - 1;
			while((j >= 0) && (listSort[j] > v)){
				listSort[j + 1] = listSort[j];
				j--;
			}
			listSort[j + 1] = v;
			trace(listSort, listCount);
		}
	}

	private static void trace(int[] listSort, int listCount){
		int jugeCount = listCount - 1;
		for(int i = 0; i < listCount; i++){
			System.out.print(listSort[i]);
			if(i < jugeCount){
				System.out.print(" ");
			}
		}
		System.out.print("\n");
	}
} public class Main {
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int listCount = scanner.nextInt();
		int[] listSort = new int[listCount];
		for(int i = 0; i < listCount; i++){
			listSort[i] = scanner.nextInt();
		}
		trace(listSort, listCount);
		insertionSort(listSort, listCount);
	}

	private static void insertionSort(int[] listSort, int listCount){
		for(int i = 1; i < listCount; i++){
			int v = listSort[i];
			int j = i - 1;
			while((j >= 0) && (listSort[j] > v)){
				listSort[j + 1] = listSort[j];
				j--;
			}
			listSort[j + 1] = v;
			trace(listSort, listCount);
		}
	}

	private static void trace(int[] listSort, int listCount){
		int jugeCount = listCount - 1;
		for(int i = 0; i < listCount; i++){
			System.out.print(listSort[i]);
			if(i < jugeCount){
				System.out.print(" ");
			}
		}
		System.out.print("\n");
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int listCount = scanner.nextInt();
		int[] listSort = new int[listCount];
		for(int i = 0; i < listCount; i++){
			listSort[i] = scanner.nextInt();
		}
		trace(listSort, listCount);
		insertionSort(listSort, listCount);
	}

	private static void insertionSort(int[] listSort, int listCount){
		for(int i = 1; i < listCount; i++){
			int v = listSort[i];
			int j = i - 1;
			while((j >= 0) && (listSort[j] > v)){
				listSort[j + 1] = listSort[j];
				j--;
			}
			listSort[j + 1] = v;
			trace(listSort, listCount);
		}
	}

	private static void trace(int[] listSort, int listCount){
		int jugeCount = listCount - 1;
		for(int i = 0; i < listCount; i++){
			System.out.print(listSort[i]);
			if(i < jugeCount){
				System.out.print(" ");
			}
		}
		System.out.print("\n");
	}
}