import java.util.Scanner;

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

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

