import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] a = new int[N];
		for (int i = 0 ; i < N; i++)
			a[i] = sc.nextInt();
		for (int i = 0; i < N; i++) {
			int trg = a[i];
			int j = i - 1;
			while (j >= 0 && trg < a[j]){
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = trg;
			for (int k = 0; k < a.length-1; k++)
				System.out.printf("%d ", a[k]);
			System.out.println(a[a.length-1]);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] a = new int[N];
		for (int i = 0 ; i < N; i++)
			a[i] = sc.nextInt();
		for (int i = 0; i < N; i++) {
			int trg = a[i];
			int j = i - 1;
			while (j >= 0 && trg < a[j]){
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = trg;
			for (int k = 0; k < a.length-1; k++)
				System.out.printf("%d ", a[k]);
			System.out.println(a[a.length-1]);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] a = new int[N];
		for (int i = 0 ; i < N; i++)
			a[i] = sc.nextInt();
		for (int i = 0; i < N; i++) {
			int trg = a[i];
			int j = i - 1;
			while (j >= 0 && trg < a[j]){
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = trg;
			for (int k = 0; k < a.length-1; k++)
				System.out.printf("%d ", a[k]);
			System.out.println(a[a.length-1]);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] a = new int[N];
		for (int i = 0 ; i < N; i++)
			a[i] = sc.nextInt();
		for (int i = 0; i < N; i++) {
			int trg = a[i];
			int j = i - 1;
			while (j >= 0 && trg < a[j]){
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = trg;
			for (int k = 0; k < a.length-1; k++)
				System.out.printf("%d ", a[k]);
			System.out.println(a[a.length-1]);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] a = new int[N]; a new int[N] N for (int i = 0 ; i < N; i++)
			a[i] = sc.nextInt(); int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i a[i] = sc.nextInt(); a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc for (int i = 0; i < N; i++) {
			int trg = a[i];
			int j = i - 1;
			while (j >= 0 && trg < a[j]){
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = trg;
			for (int k = 0; k < a.length-1; k++)
				System.out.printf("%d ", a[k]);
			System.out.println(a[a.length-1]);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			int trg = a[i];
			int j = i - 1;
			while (j >= 0 && trg < a[j]){
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = trg;
			for (int k = 0; k < a.length-1; k++)
				System.out.printf("%d ", a[k]);
			System.out.println(a[a.length-1]);
		} {
			int trg = a[i];
			int j = i - 1;
			while (j >= 0 && trg < a[j]){
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = trg;
			for (int k = 0; k < a.length-1; k++)
				System.out.printf("%d ", a[k]);
			System.out.println(a[a.length-1]);
		} int trg = a[i]; trg a[i] a i int j = i - 1; j i - 1 i 1 while (j >= 0 && trg < a[j]){
				a[j+1] = a[j];
				j--;
			} j >= 0 && trg < a[j] j >= 0 j 0 trg < a[j] trg 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] = trg a[j+1] a j+1 j 1 trg for (int k = 0; k < a.length-1; k++)
				System.out.printf("%d ", a[k]); int k = 0; int k = 0; k 0 k < a.length-1 k a.length-1 a.length a a.length 1 k++ k++ k System.out.printf("%d ", a[k]); System.out.printf("%d ", a[k]) System.out.printf System.out System System.out "%d " a[k] a k System.out.println(a[a.length-1]) System.out.println System.out System System.out a[a.length-1] a a.length-1 a.length a a.length 1 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] a = new int[N];
		for (int i = 0 ; i < N; i++)
			a[i] = sc.nextInt();
		for (int i = 0; i < N; i++) {
			int trg = a[i];
			int j = i - 1;
			while (j >= 0 && trg < a[j]){
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = trg;
			for (int k = 0; k < a.length-1; k++)
				System.out.printf("%d ", a[k]);
			System.out.println(a[a.length-1]);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] a = new int[N];
		for (int i = 0 ; i < N; i++)
			a[i] = sc.nextInt();
		for (int i = 0; i < N; i++) {
			int trg = a[i];
			int j = i - 1;
			while (j >= 0 && trg < a[j]){
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = trg;
			for (int k = 0; k < a.length-1; k++)
				System.out.printf("%d ", a[k]);
			System.out.println(a[a.length-1]);
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] a = new int[N];
		for (int i = 0 ; i < N; i++)
			a[i] = sc.nextInt();
		for (int i = 0; i < N; i++) {
			int trg = a[i];
			int j = i - 1;
			while (j >= 0 && trg < a[j]){
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = trg;
			for (int k = 0; k < a.length-1; k++)
				System.out.printf("%d ", a[k]);
			System.out.println(a[a.length-1]);
		}
	}
}