import java.util.Scanner;
public class Main{

private static Scanner scanner;

public static void main(String args[])
{
	scanner = new Scanner(System.in);
	int a = scanner.nextInt();
	int[] b = new int[a];
	for(int i = 0;i < a;i++) {
		b[i] = scanner.nextInt();

	}
	for(int i = 0;i < a;i++) {
		int v = b[i];
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
			if(c == a-1) {}
			else {
			System.out.print(" ");
			}
		}
		System.out.println("");
		}

	}
}
 import java.util.Scanner; Scanner java.util public class Main{

private static Scanner scanner;

public static void main(String args[])
{
	scanner = new Scanner(System.in);
	int a = scanner.nextInt();
	int[] b = new int[a];
	for(int i = 0;i < a;i++) {
		b[i] = scanner.nextInt();

	}
	for(int i = 0;i < a;i++) {
		int v = b[i];
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
			if(c == a-1) {}
			else {
			System.out.print(" ");
			}
		}
		System.out.println("");
		}

	}
} Main private static Scanner scanner; scanner public static void main(String args[])
{
	scanner = new Scanner(System.in);
	int a = scanner.nextInt();
	int[] b = new int[a];
	for(int i = 0;i < a;i++) {
		b[i] = scanner.nextInt();

	}
	for(int i = 0;i < a;i++) {
		int v = b[i];
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
			if(c == a-1) {}
			else {
			System.out.print(" ");
			}
		}
		System.out.println("");
		}

	} main {
	scanner = new Scanner(System.in);
	int a = scanner.nextInt();
	int[] b = new int[a];
	for(int i = 0;i < a;i++) {
		b[i] = scanner.nextInt();

	}
	for(int i = 0;i < a;i++) {
		int v = b[i];
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
			if(c == a-1) {}
			else {
			System.out.print(" ");
			}
		}
		System.out.println("");
		}

	} scanner = new Scanner(System.in) scanner new Scanner(System.in) int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int[] b = new int[a]; b new int[a] a for(int i = 0;i < a;i++) {
		b[i] = scanner.nextInt();

	} int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
		b[i] = scanner.nextInt();

	} {
		b[i] = scanner.nextInt();

	} b[i] = scanner.nextInt() b[i] b i scanner.nextInt() scanner.nextInt scanner for(int i = 0;i < a;i++) {
		int v = b[i];
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
			if(c == a-1) {}
			else {
			System.out.print(" ");
			}
		}
		System.out.println("");
		} int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
		int v = b[i];
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
			if(c == a-1) {}
			else {
			System.out.print(" ");
			}
		}
		System.out.println("");
		} {
		int v = b[i];
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
			if(c == a-1) {}
			else {
			System.out.print(" ");
			}
		}
		System.out.println("");
		} int v = b[i]; v b[i] b i int j = i-1; j i-1 i 1 while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		} j >= 0 && b[j] > v j >= 0 j 0 b[j] > v b[j] b j v {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		} b[j+1] = b[j] b[j+1] b j+1 j 1 b[j] b j j-- j b[j+1] = v b[j+1] b j+1 j 1 v for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
			if(c == a-1) {}
			else {
			System.out.print(" ");
			}
		} int c = 0; int c = 0; c 0 c < a c a c++ c++ c {
			System.out.print(b[c]);
			if(c == a-1) {}
			else {
			System.out.print(" ");
			}
		} {
			System.out.print(b[c]);
			if(c == a-1) {}
			else {
			System.out.print(" ");
			}
		} System.out.print(b[c]) System.out.print System.out System System.out b[c] b c if(c == a-1) {}
			else {
			System.out.print(" ");
			} c == a-1 c a-1 a 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 "" String args[] args public class Main{

private static Scanner scanner;

public static void main(String args[])
{
	scanner = new Scanner(System.in);
	int a = scanner.nextInt();
	int[] b = new int[a];
	for(int i = 0;i < a;i++) {
		b[i] = scanner.nextInt();

	}
	for(int i = 0;i < a;i++) {
		int v = b[i];
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
			if(c == a-1) {}
			else {
			System.out.print(" ");
			}
		}
		System.out.println("");
		}

	}
} public class Main{

private static Scanner scanner;

public static void main(String args[])
{
	scanner = new Scanner(System.in);
	int a = scanner.nextInt();
	int[] b = new int[a];
	for(int i = 0;i < a;i++) {
		b[i] = scanner.nextInt();

	}
	for(int i = 0;i < a;i++) {
		int v = b[i];
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
			if(c == a-1) {}
			else {
			System.out.print(" ");
			}
		}
		System.out.println("");
		}

	}
} Main
import java.util.Scanner;
public class Main{

private static Scanner scanner;

public static void main(String args[])
{
	scanner = new Scanner(System.in);
	int a = scanner.nextInt();
	int[] b = new int[a];
	for(int i = 0;i < a;i++) {
		b[i] = scanner.nextInt();

	}
	for(int i = 0;i < a;i++) {
		int v = b[i];
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
			if(c == a-1) {}
			else {
			System.out.print(" ");
			}
		}
		System.out.println("");
		}

	}
}

