import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Throwable {
		Scanner sc = new Scanner(System.in);
//		Scanner sc = new Scanner(new File("test_1.txt"));
		List<Integer> a = new ArrayList<Integer>();
		int N = sc.nextInt();
		for (int i = 0; i < N; i++)
			a.add(sc.nextInt());
		sc.close();
		
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < N; i++) {
			// 0..i-1??????????????????
			int a_i = a.get(i);
			int j = i - 1;
			while (j >= 0 && a.get(j) > a_i) {
				a.set(j + 1, a.get(j));
				j--;
			}
			a.set(j + 1, a_i);
			
			// ??????
			for (int k = 0; k < a.size(); k++) {
				sb.append(a.get(k));
				if (k != a.size() - 1)
					sb.append(' ');
			}
			sb.append('\n');
		}
		
		System.out.print(sb.toString());
	}
} import java.io.File; File java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Throwable {
		Scanner sc = new Scanner(System.in);
//		Scanner sc = new Scanner(new File("test_1.txt"));
		List<Integer> a = new ArrayList<Integer>();
		int N = sc.nextInt();
		for (int i = 0; i < N; i++)
			a.add(sc.nextInt());
		sc.close();
		
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < N; i++) {
			// 0..i-1??????????????????
			int a_i = a.get(i);
			int j = i - 1;
			while (j >= 0 && a.get(j) > a_i) {
				a.set(j + 1, a.get(j));
				j--;
			}
			a.set(j + 1, a_i);
			
			// ??????
			for (int k = 0; k < a.size(); k++) {
				sb.append(a.get(k));
				if (k != a.size() - 1)
					sb.append(' ');
			}
			sb.append('\n');
		}
		
		System.out.print(sb.toString());
	}
} Main public static void main(String[] args) throws Throwable {
		Scanner sc = new Scanner(System.in);
//		Scanner sc = new Scanner(new File("test_1.txt"));
		List<Integer> a = new ArrayList<Integer>();
		int N = sc.nextInt();
		for (int i = 0; i < N; i++)
			a.add(sc.nextInt());
		sc.close();
		
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < N; i++) {
			// 0..i-1??????????????????
			int a_i = a.get(i);
			int j = i - 1;
			while (j >= 0 && a.get(j) > a_i) {
				a.set(j + 1, a.get(j));
				j--;
			}
			a.set(j + 1, a_i);
			
			// ??????
			for (int k = 0; k < a.size(); k++) {
				sb.append(a.get(k));
				if (k != a.size() - 1)
					sb.append(' ');
			}
			sb.append('\n');
		}
		
		System.out.print(sb.toString());
	} main {
		Scanner sc = new Scanner(System.in);
//		Scanner sc = new Scanner(new File("test_1.txt"));
		List<Integer> a = new ArrayList<Integer>();
		int N = sc.nextInt();
		for (int i = 0; i < N; i++)
			a.add(sc.nextInt());
		sc.close();
		
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < N; i++) {
			// 0..i-1??????????????????
			int a_i = a.get(i);
			int j = i - 1;
			while (j >= 0 && a.get(j) > a_i) {
				a.set(j + 1, a.get(j));
				j--;
			}
			a.set(j + 1, a_i);
			
			// ??????
			for (int k = 0; k < a.size(); k++) {
				sb.append(a.get(k));
				if (k != a.size() - 1)
					sb.append(' ');
			}
			sb.append('\n');
		}
		
		System.out.print(sb.toString());
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) List<Integer> a = new ArrayList<Integer>(); a new ArrayList<Integer>() int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc for (int i = 0; i < N; i++)
			a.add(sc.nextInt()); int i = 0; int i = 0; i 0 i < N i N i++ i++ i a.add(sc.nextInt()); a.add(sc.nextInt()) a.add a sc.nextInt() sc.nextInt sc sc.close() sc.close sc StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int i = 0; i < N; i++) {
			// 0..i-1??????????????????
			int a_i = a.get(i);
			int j = i - 1;
			while (j >= 0 && a.get(j) > a_i) {
				a.set(j + 1, a.get(j));
				j--;
			}
			a.set(j + 1, a_i);
			
			// ??????
			for (int k = 0; k < a.size(); k++) {
				sb.append(a.get(k));
				if (k != a.size() - 1)
					sb.append(' ');
			}
			sb.append('\n');
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			// 0..i-1??????????????????
			int a_i = a.get(i);
			int j = i - 1;
			while (j >= 0 && a.get(j) > a_i) {
				a.set(j + 1, a.get(j));
				j--;
			}
			a.set(j + 1, a_i);
			
			// ??????
			for (int k = 0; k < a.size(); k++) {
				sb.append(a.get(k));
				if (k != a.size() - 1)
					sb.append(' ');
			}
			sb.append('\n');
		} {
			// 0..i-1??????????????????
			int a_i = a.get(i);
			int j = i - 1;
			while (j >= 0 && a.get(j) > a_i) {
				a.set(j + 1, a.get(j));
				j--;
			}
			a.set(j + 1, a_i);
			
			// ??????
			for (int k = 0; k < a.size(); k++) {
				sb.append(a.get(k));
				if (k != a.size() - 1)
					sb.append(' ');
			}
			sb.append('\n');
		} int a_i = a.get(i); a_i a.get(i) a.get a i int j = i - 1; j i - 1 i 1 while (j >= 0 && a.get(j) > a_i) {
				a.set(j + 1, a.get(j));
				j--;
			} j >= 0 && a.get(j) > a_i j >= 0 j 0 a.get(j) > a_i a.get(j) a.get a j a_i {
				a.set(j + 1, a.get(j));
				j--;
			} a.set(j + 1, a.get(j)) a.set a j + 1 j 1 a.get(j) a.get a j j-- j a.set(j + 1, a_i) a.set a j + 1 j 1 a_i for (int k = 0; k < a.size(); k++) {
				sb.append(a.get(k));
				if (k != a.size() - 1)
					sb.append(' ');
			} int k = 0; int k = 0; k 0 k < a.size() k a.size() a.size a k++ k++ k {
				sb.append(a.get(k));
				if (k != a.size() - 1)
					sb.append(' ');
			} {
				sb.append(a.get(k));
				if (k != a.size() - 1)
					sb.append(' ');
			} sb.append(a.get(k)) sb.append sb a.get(k) a.get a k if (k != a.size() - 1)
					sb.append(' '); k != a.size() - 1 k a.size() - 1 a.size() a.size a 1 sb.append(' ') sb.append sb ' ' sb.append('\n') sb.append sb '\n' System.out.print(sb.toString()) System.out.print System.out System System.out sb.toString() sb.toString sb String[] args args public class Main {
	public static void main(String[] args) throws Throwable {
		Scanner sc = new Scanner(System.in);
//		Scanner sc = new Scanner(new File("test_1.txt"));
		List<Integer> a = new ArrayList<Integer>();
		int N = sc.nextInt();
		for (int i = 0; i < N; i++)
			a.add(sc.nextInt());
		sc.close();
		
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < N; i++) {
			// 0..i-1??????????????????
			int a_i = a.get(i);
			int j = i - 1;
			while (j >= 0 && a.get(j) > a_i) {
				a.set(j + 1, a.get(j));
				j--;
			}
			a.set(j + 1, a_i);
			
			// ??????
			for (int k = 0; k < a.size(); k++) {
				sb.append(a.get(k));
				if (k != a.size() - 1)
					sb.append(' ');
			}
			sb.append('\n');
		}
		
		System.out.print(sb.toString());
	}
} public class Main {
	public static void main(String[] args) throws Throwable {
		Scanner sc = new Scanner(System.in);
//		Scanner sc = new Scanner(new File("test_1.txt"));
		List<Integer> a = new ArrayList<Integer>();
		int N = sc.nextInt();
		for (int i = 0; i < N; i++)
			a.add(sc.nextInt());
		sc.close();
		
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < N; i++) {
			// 0..i-1??????????????????
			int a_i = a.get(i);
			int j = i - 1;
			while (j >= 0 && a.get(j) > a_i) {
				a.set(j + 1, a.get(j));
				j--;
			}
			a.set(j + 1, a_i);
			
			// ??????
			for (int k = 0; k < a.size(); k++) {
				sb.append(a.get(k));
				if (k != a.size() - 1)
					sb.append(' ');
			}
			sb.append('\n');
		}
		
		System.out.print(sb.toString());
	}
} Main
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Throwable {
		Scanner sc = new Scanner(System.in);
//		Scanner sc = new Scanner(new File("test_1.txt"));
		List<Integer> a = new ArrayList<Integer>();
		int N = sc.nextInt();
		for (int i = 0; i < N; i++)
			a.add(sc.nextInt());
		sc.close();
		
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < N; i++) {
			// 0..i-1??????????????????
			int a_i = a.get(i);
			int j = i - 1;
			while (j >= 0 && a.get(j) > a_i) {
				a.set(j + 1, a.get(j));
				j--;
			}
			a.set(j + 1, a_i);
			
			// ??????
			for (int k = 0; k < a.size(); k++) {
				sb.append(a.get(k));
				if (k != a.size() - 1)
					sb.append(' ');
			}
			sb.append('\n');
		}
		
		System.out.print(sb.toString());
	}
}