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

public class Main {

	public static void main(String[] args) throws Exception {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int number = Integer.parseInt(br.readLine());

		String[] inputValueAry = br.readLine().split(" ");
		int[] array = new int[inputValueAry.length];
		for (int i = 0; i < inputValueAry.length; i ++) {
			array[i] = Integer.parseInt(inputValueAry[i]);
		}
		insertionSort(array, number);
	}

	public static void insertionSort(int[] array, int number) {

		printArray(array);
		for (int i = 1; i < number; i ++) {
			int v = array[i];
			int j = i - 1;
			while (j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			printArray(array);
		}
	}

	public static void printArray(int[] array) {
		for (int i = 0; i < array.length; i ++) {
			if (i != 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		}
		System.out.println("");
	}
}
 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 br = new BufferedReader(new InputStreamReader(System.in));
		int number = Integer.parseInt(br.readLine());

		String[] inputValueAry = br.readLine().split(" ");
		int[] array = new int[inputValueAry.length];
		for (int i = 0; i < inputValueAry.length; i ++) {
			array[i] = Integer.parseInt(inputValueAry[i]);
		}
		insertionSort(array, number);
	}

	public static void insertionSort(int[] array, int number) {

		printArray(array);
		for (int i = 1; i < number; i ++) {
			int v = array[i];
			int j = i - 1;
			while (j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			printArray(array);
		}
	}

	public static void printArray(int[] array) {
		for (int i = 0; i < array.length; i ++) {
			if (i != 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		}
		System.out.println("");
	}
} Main public static void main(String[] args) throws Exception {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int number = Integer.parseInt(br.readLine());

		String[] inputValueAry = br.readLine().split(" ");
		int[] array = new int[inputValueAry.length];
		for (int i = 0; i < inputValueAry.length; i ++) {
			array[i] = Integer.parseInt(inputValueAry[i]);
		}
		insertionSort(array, number);
	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int number = Integer.parseInt(br.readLine());

		String[] inputValueAry = br.readLine().split(" ");
		int[] array = new int[inputValueAry.length];
		for (int i = 0; i < inputValueAry.length; i ++) {
			array[i] = Integer.parseInt(inputValueAry[i]);
		}
		insertionSort(array, number);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int number = Integer.parseInt(br.readLine()); number Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] inputValueAry = br.readLine().split(" "); inputValueAry br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] array = new int[inputValueAry.length]; array new int[inputValueAry.length] inputValueAry.length inputValueAry inputValueAry.length for (int i = 0; i < inputValueAry.length; i ++) {
			array[i] = Integer.parseInt(inputValueAry[i]);
		} int i = 0; int i = 0; i 0 i < inputValueAry.length i inputValueAry.length inputValueAry inputValueAry.length i ++ i ++ i {
			array[i] = Integer.parseInt(inputValueAry[i]);
		} {
			array[i] = Integer.parseInt(inputValueAry[i]);
		} array[i] = Integer.parseInt(inputValueAry[i]) array[i] array i Integer.parseInt(inputValueAry[i]) Integer.parseInt Integer inputValueAry[i] inputValueAry i insertionSort(array, number) insertionSort array number String[] args args public static void insertionSort(int[] array, int number) {

		printArray(array);
		for (int i = 1; i < number; i ++) {
			int v = array[i];
			int j = i - 1;
			while (j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			printArray(array);
		}
	} insertionSort {

		printArray(array);
		for (int i = 1; i < number; i ++) {
			int v = array[i];
			int j = i - 1;
			while (j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			printArray(array);
		}
	} printArray(array) printArray array for (int i = 1; i < number; i ++) {
			int v = array[i];
			int j = i - 1;
			while (j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			printArray(array);
		} int i = 1; int i = 1; i 1 i < number i number i ++ i ++ i {
			int v = array[i];
			int j = i - 1;
			while (j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			printArray(array);
		} {
			int v = array[i];
			int j = i - 1;
			while (j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			printArray(array);
		} int v = array[i]; v array[i] array i int j = i - 1; j i - 1 i 1 while (j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			} j >= 0 && array[j] > v j >= 0 j 0 array[j] > v array[j] array j v {
				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] = v array[j + 1] array j + 1 j 1 v printArray(array) printArray array int[] array array int number number public static void printArray(int[] array) {
		for (int i = 0; i < array.length; i ++) {
			if (i != 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		}
		System.out.println("");
	} printArray {
		for (int i = 0; i < array.length; i ++) {
			if (i != 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		}
		System.out.println("");
	} for (int i = 0; i < array.length; i ++) {
			if (i != 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		} int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i ++ i ++ i {
			if (i != 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		} {
			if (i != 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		} if (i != 0) {
				System.out.print(" ");
			} i != 0 i 0 {
				System.out.print(" ");
			} System.out.print(" ") System.out.print System.out System System.out " " System.out.print(array[i]) System.out.print System.out System System.out array[i] array i System.out.println("") System.out.println System.out System System.out "" int[] array array public class Main {

	public static void main(String[] args) throws Exception {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int number = Integer.parseInt(br.readLine());

		String[] inputValueAry = br.readLine().split(" ");
		int[] array = new int[inputValueAry.length];
		for (int i = 0; i < inputValueAry.length; i ++) {
			array[i] = Integer.parseInt(inputValueAry[i]);
		}
		insertionSort(array, number);
	}

	public static void insertionSort(int[] array, int number) {

		printArray(array);
		for (int i = 1; i < number; i ++) {
			int v = array[i];
			int j = i - 1;
			while (j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			printArray(array);
		}
	}

	public static void printArray(int[] array) {
		for (int i = 0; i < array.length; i ++) {
			if (i != 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		}
		System.out.println("");
	}
} public class Main {

	public static void main(String[] args) throws Exception {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int number = Integer.parseInt(br.readLine());

		String[] inputValueAry = br.readLine().split(" ");
		int[] array = new int[inputValueAry.length];
		for (int i = 0; i < inputValueAry.length; i ++) {
			array[i] = Integer.parseInt(inputValueAry[i]);
		}
		insertionSort(array, number);
	}

	public static void insertionSort(int[] array, int number) {

		printArray(array);
		for (int i = 1; i < number; i ++) {
			int v = array[i];
			int j = i - 1;
			while (j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			printArray(array);
		}
	}

	public static void printArray(int[] array) {
		for (int i = 0; i < array.length; i ++) {
			if (i != 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		}
		System.out.println("");
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int number = Integer.parseInt(br.readLine());

		String[] inputValueAry = br.readLine().split(" ");
		int[] array = new int[inputValueAry.length];
		for (int i = 0; i < inputValueAry.length; i ++) {
			array[i] = Integer.parseInt(inputValueAry[i]);
		}
		insertionSort(array, number);
	}

	public static void insertionSort(int[] array, int number) {

		printArray(array);
		for (int i = 1; i < number; i ++) {
			int v = array[i];
			int j = i - 1;
			while (j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			printArray(array);
		}
	}

	public static void printArray(int[] array) {
		for (int i = 0; i < array.length; i ++) {
			if (i != 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		}
		System.out.println("");
	}
}

