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 nums[] = new int[n];
		String str[] = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			nums[i] = Integer.parseInt(str[i]);
		}
		for (int j = 0; j < n; j++) {
			int v = nums[j];
			int s = j - 1;
			while (s >= 0 && nums[s] > v) {
				nums[s + 1] = nums[s];
				s--;
			}
			nums[s + 1] = v;
			for (int p = 0; p < n; p++) {
				if (p == (n - 1)) {
					System.out.println(nums[p]);
				} else {
					System.out.print(nums[p] + " ");
				}
			}
		}
	}
} 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 nums[] = new int[n];
		String str[] = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			nums[i] = Integer.parseInt(str[i]);
		}
		for (int j = 0; j < n; j++) {
			int v = nums[j];
			int s = j - 1;
			while (s >= 0 && nums[s] > v) {
				nums[s + 1] = nums[s];
				s--;
			}
			nums[s + 1] = v;
			for (int p = 0; p < n; p++) {
				if (p == (n - 1)) {
					System.out.println(nums[p]);
				} else {
					System.out.print(nums[p] + " ");
				}
			}
		}
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int nums[] = new int[n];
		String str[] = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			nums[i] = Integer.parseInt(str[i]);
		}
		for (int j = 0; j < n; j++) {
			int v = nums[j];
			int s = j - 1;
			while (s >= 0 && nums[s] > v) {
				nums[s + 1] = nums[s];
				s--;
			}
			nums[s + 1] = v;
			for (int p = 0; p < n; p++) {
				if (p == (n - 1)) {
					System.out.println(nums[p]);
				} else {
					System.out.print(nums[p] + " ");
				}
			}
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int nums[] = new int[n];
		String str[] = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			nums[i] = Integer.parseInt(str[i]);
		}
		for (int j = 0; j < n; j++) {
			int v = nums[j];
			int s = j - 1;
			while (s >= 0 && nums[s] > v) {
				nums[s + 1] = nums[s];
				s--;
			}
			nums[s + 1] = v;
			for (int p = 0; p < n; p++) {
				if (p == (n - 1)) {
					System.out.println(nums[p]);
				} else {
					System.out.print(nums[p] + " ");
				}
			}
		}
	} 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 nums[] = new int[n]; nums new int[n] n String str[] = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (int i = 0; i < n; i++) {
			nums[i] = Integer.parseInt(str[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			nums[i] = Integer.parseInt(str[i]);
		} {
			nums[i] = Integer.parseInt(str[i]);
		} nums[i] = Integer.parseInt(str[i]) nums[i] nums i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i for (int j = 0; j < n; j++) {
			int v = nums[j];
			int s = j - 1;
			while (s >= 0 && nums[s] > v) {
				nums[s + 1] = nums[s];
				s--;
			}
			nums[s + 1] = v;
			for (int p = 0; p < n; p++) {
				if (p == (n - 1)) {
					System.out.println(nums[p]);
				} else {
					System.out.print(nums[p] + " ");
				}
			}
		} int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
			int v = nums[j];
			int s = j - 1;
			while (s >= 0 && nums[s] > v) {
				nums[s + 1] = nums[s];
				s--;
			}
			nums[s + 1] = v;
			for (int p = 0; p < n; p++) {
				if (p == (n - 1)) {
					System.out.println(nums[p]);
				} else {
					System.out.print(nums[p] + " ");
				}
			}
		} {
			int v = nums[j];
			int s = j - 1;
			while (s >= 0 && nums[s] > v) {
				nums[s + 1] = nums[s];
				s--;
			}
			nums[s + 1] = v;
			for (int p = 0; p < n; p++) {
				if (p == (n - 1)) {
					System.out.println(nums[p]);
				} else {
					System.out.print(nums[p] + " ");
				}
			}
		} int v = nums[j]; v nums[j] nums j int s = j - 1; s j - 1 j 1 while (s >= 0 && nums[s] > v) {
				nums[s + 1] = nums[s];
				s--;
			} s >= 0 && nums[s] > v s >= 0 s 0 nums[s] > v nums[s] nums s v {
				nums[s + 1] = nums[s];
				s--;
			} nums[s + 1] = nums[s] nums[s + 1] nums s + 1 s 1 nums[s] nums s s-- s nums[s + 1] = v nums[s + 1] nums s + 1 s 1 v for (int p = 0; p < n; p++) {
				if (p == (n - 1)) {
					System.out.println(nums[p]);
				} else {
					System.out.print(nums[p] + " ");
				}
			} int p = 0; int p = 0; p 0 p < n p n p++ p++ p {
				if (p == (n - 1)) {
					System.out.println(nums[p]);
				} else {
					System.out.print(nums[p] + " ");
				}
			} {
				if (p == (n - 1)) {
					System.out.println(nums[p]);
				} else {
					System.out.print(nums[p] + " ");
				}
			} if (p == (n - 1)) {
					System.out.println(nums[p]);
				} else {
					System.out.print(nums[p] + " ");
				} p == (n - 1) p (n - 1) n 1 {
					System.out.println(nums[p]);
				} System.out.println(nums[p]) System.out.println System.out System System.out nums[p] nums p {
					System.out.print(nums[p] + " ");
				} System.out.print(nums[p] + " ") System.out.print System.out System System.out nums[p] + " " nums[p] nums p " " String[] args args 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 nums[] = new int[n];
		String str[] = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			nums[i] = Integer.parseInt(str[i]);
		}
		for (int j = 0; j < n; j++) {
			int v = nums[j];
			int s = j - 1;
			while (s >= 0 && nums[s] > v) {
				nums[s + 1] = nums[s];
				s--;
			}
			nums[s + 1] = v;
			for (int p = 0; p < n; p++) {
				if (p == (n - 1)) {
					System.out.println(nums[p]);
				} else {
					System.out.print(nums[p] + " ");
				}
			}
		}
	}
} 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 nums[] = new int[n];
		String str[] = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			nums[i] = Integer.parseInt(str[i]);
		}
		for (int j = 0; j < n; j++) {
			int v = nums[j];
			int s = j - 1;
			while (s >= 0 && nums[s] > v) {
				nums[s + 1] = nums[s];
				s--;
			}
			nums[s + 1] = v;
			for (int p = 0; p < n; p++) {
				if (p == (n - 1)) {
					System.out.println(nums[p]);
				} else {
					System.out.print(nums[p] + " ");
				}
			}
		}
	}
} 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 nums[] = new int[n];
		String str[] = br.readLine().split(" ");

		for (int i = 0; i < n; i++) {
			nums[i] = Integer.parseInt(str[i]);
		}
		for (int j = 0; j < n; j++) {
			int v = nums[j];
			int s = j - 1;
			while (s >= 0 && nums[s] > v) {
				nums[s + 1] = nums[s];
				s--;
			}
			nums[s + 1] = v;
			for (int p = 0; p < n; p++) {
				if (p == (n - 1)) {
					System.out.println(nums[p]);
				} else {
					System.out.print(nums[p] + " ");
				}
			}
		}
	}
}