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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] array = new int[n];
		String[] strArray = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			array[i] = Integer.parseInt(strArray[i]);
		}
		insertionSort(array, n);
	}

	public static void insertionSort(int[] A, int N) {
		for (int i = 0; i < N; i++) {
			int temp = A[i];
			int j = i - 1;
			while (j >= 0 && temp < A[j]) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = temp;
			toArray(A);
		}
	}

	public static void toArray(int[] target) {
		for (int i = 0; i < target.length; i++) {
			System.out.print(target[i]);
			if (i < target.length - 1) System.out.print(" ");
		}
		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 IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] array = new int[n];
		String[] strArray = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			array[i] = Integer.parseInt(strArray[i]);
		}
		insertionSort(array, n);
	}

	public static void insertionSort(int[] A, int N) {
		for (int i = 0; i < N; i++) {
			int temp = A[i];
			int j = i - 1;
			while (j >= 0 && temp < A[j]) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = temp;
			toArray(A);
		}
	}

	public static void toArray(int[] target) {
		for (int i = 0; i < target.length; i++) {
			System.out.print(target[i]);
			if (i < target.length - 1) System.out.print(" ");
		}
		System.out.println("");
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] array = new int[n];
		String[] strArray = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			array[i] = Integer.parseInt(strArray[i]);
		}
		insertionSort(array, n);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] array = new int[n];
		String[] strArray = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			array[i] = Integer.parseInt(strArray[i]);
		}
		insertionSort(array, n);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[] array = new int[n]; array new int[n] n String[] strArray = br.readLine().split(" "); strArray br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (int i = 0; i < n; i++) {
			array[i] = Integer.parseInt(strArray[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			array[i] = Integer.parseInt(strArray[i]);
		} {
			array[i] = Integer.parseInt(strArray[i]);
		} array[i] = Integer.parseInt(strArray[i]) array[i] array i Integer.parseInt(strArray[i]) Integer.parseInt Integer strArray[i] strArray i insertionSort(array, n) insertionSort array n String[] args args public static void insertionSort(int[] A, int N) {
		for (int i = 0; i < N; i++) {
			int temp = A[i];
			int j = i - 1;
			while (j >= 0 && temp < A[j]) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = temp;
			toArray(A);
		}
	} insertionSort {
		for (int i = 0; i < N; i++) {
			int temp = A[i];
			int j = i - 1;
			while (j >= 0 && temp < A[j]) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = temp;
			toArray(A);
		}
	} for (int i = 0; i < N; i++) {
			int temp = A[i];
			int j = i - 1;
			while (j >= 0 && temp < A[j]) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = temp;
			toArray(A);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			int temp = A[i];
			int j = i - 1;
			while (j >= 0 && temp < A[j]) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = temp;
			toArray(A);
		} {
			int temp = A[i];
			int j = i - 1;
			while (j >= 0 && temp < A[j]) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = temp;
			toArray(A);
		} int temp = A[i]; temp A[i] A i int j = i - 1; j i - 1 i 1 while (j >= 0 && temp < A[j]) {
				A[j + 1] = A[j];
				j--;
			} j >= 0 && temp < A[j] j >= 0 j 0 temp < A[j] temp A[j] A j {
				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] = temp A[j + 1] A j + 1 j 1 temp toArray(A) toArray A int[] A A int N N public static void toArray(int[] target) {
		for (int i = 0; i < target.length; i++) {
			System.out.print(target[i]);
			if (i < target.length - 1) System.out.print(" ");
		}
		System.out.println("");
	} toArray {
		for (int i = 0; i < target.length; i++) {
			System.out.print(target[i]);
			if (i < target.length - 1) System.out.print(" ");
		}
		System.out.println("");
	} for (int i = 0; i < target.length; i++) {
			System.out.print(target[i]);
			if (i < target.length - 1) System.out.print(" ");
		} int i = 0; int i = 0; i 0 i < target.length i target.length target target.length i++ i++ i {
			System.out.print(target[i]);
			if (i < target.length - 1) System.out.print(" ");
		} {
			System.out.print(target[i]);
			if (i < target.length - 1) System.out.print(" ");
		} System.out.print(target[i]) System.out.print System.out System System.out target[i] target i if (i < target.length - 1) System.out.print(" "); i < target.length - 1 i target.length - 1 target.length target target.length 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.println("") System.out.println System.out System System.out "" int[] target target public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] array = new int[n];
		String[] strArray = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			array[i] = Integer.parseInt(strArray[i]);
		}
		insertionSort(array, n);
	}

	public static void insertionSort(int[] A, int N) {
		for (int i = 0; i < N; i++) {
			int temp = A[i];
			int j = i - 1;
			while (j >= 0 && temp < A[j]) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = temp;
			toArray(A);
		}
	}

	public static void toArray(int[] target) {
		for (int i = 0; i < target.length; i++) {
			System.out.print(target[i]);
			if (i < target.length - 1) System.out.print(" ");
		}
		System.out.println("");
	}
} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] array = new int[n];
		String[] strArray = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			array[i] = Integer.parseInt(strArray[i]);
		}
		insertionSort(array, n);
	}

	public static void insertionSort(int[] A, int N) {
		for (int i = 0; i < N; i++) {
			int temp = A[i];
			int j = i - 1;
			while (j >= 0 && temp < A[j]) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = temp;
			toArray(A);
		}
	}

	public static void toArray(int[] target) {
		for (int i = 0; i < target.length; i++) {
			System.out.print(target[i]);
			if (i < target.length - 1) System.out.print(" ");
		}
		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 IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] array = new int[n];
		String[] strArray = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			array[i] = Integer.parseInt(strArray[i]);
		}
		insertionSort(array, n);
	}

	public static void insertionSort(int[] A, int N) {
		for (int i = 0; i < N; i++) {
			int temp = A[i];
			int j = i - 1;
			while (j >= 0 && temp < A[j]) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = temp;
			toArray(A);
		}
	}

	public static void toArray(int[] target) {
		for (int i = 0; i < target.length; i++) {
			System.out.print(target[i]);
			if (i < target.length - 1) System.out.print(" ");
		}
		System.out.println("");
	}
}