import java.io.BufferedReader;
import java.io.InputStreamReader;
 
public class Main
{
	public static void main (String[] args) throws Exception
	{
		BufferedReader stdReader =
		new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(stdReader.readLine());
		String A[] = stdReader.readLine().split(" ",0);
		int j = 0;
		System.out.println(String.join(" ",A)); 
		for (int i = 1; i < N; i++) {
			String v = A[i];
			j = i - 1;
			while (j >= 0 && Integer.parseInt(A[j]) > Integer.parseInt(v)) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = v;
			System.out.println(String.join(" ",A)); 
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main
{
	public static void main (String[] args) throws Exception
	{
		BufferedReader stdReader =
		new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(stdReader.readLine());
		String A[] = stdReader.readLine().split(" ",0);
		int j = 0;
		System.out.println(String.join(" ",A)); 
		for (int i = 1; i < N; i++) {
			String v = A[i];
			j = i - 1;
			while (j >= 0 && Integer.parseInt(A[j]) > Integer.parseInt(v)) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = v;
			System.out.println(String.join(" ",A)); 
		}
	}
} Main public static void main (String[] args) throws Exception
	{
		BufferedReader stdReader =
		new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(stdReader.readLine());
		String A[] = stdReader.readLine().split(" ",0);
		int j = 0;
		System.out.println(String.join(" ",A)); 
		for (int i = 1; i < N; i++) {
			String v = A[i];
			j = i - 1;
			while (j >= 0 && Integer.parseInt(A[j]) > Integer.parseInt(v)) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = v;
			System.out.println(String.join(" ",A)); 
		}
	} main {
		BufferedReader stdReader =
		new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(stdReader.readLine());
		String A[] = stdReader.readLine().split(" ",0);
		int j = 0;
		System.out.println(String.join(" ",A)); 
		for (int i = 1; i < N; i++) {
			String v = A[i];
			j = i - 1;
			while (j >= 0 && Integer.parseInt(A[j]) > Integer.parseInt(v)) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = v;
			System.out.println(String.join(" ",A)); 
		}
	} BufferedReader stdReader =
		new BufferedReader(new InputStreamReader(System.in)); stdReader new BufferedReader(new InputStreamReader(System.in)) int N = Integer.parseInt(stdReader.readLine()); N Integer.parseInt(stdReader.readLine()) Integer.parseInt Integer stdReader.readLine() stdReader.readLine stdReader String A[] = stdReader.readLine().split(" ",0); A stdReader.readLine().split(" ",0) stdReader.readLine().split stdReader.readLine() stdReader.readLine stdReader " " 0 int j = 0; j 0 System.out.println(String.join(" ",A)) System.out.println System.out System System.out String.join(" ",A) String.join String " " A for (int i = 1; i < N; i++) {
			String v = A[i];
			j = i - 1;
			while (j >= 0 && Integer.parseInt(A[j]) > Integer.parseInt(v)) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = v;
			System.out.println(String.join(" ",A)); 
		} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
			String v = A[i];
			j = i - 1;
			while (j >= 0 && Integer.parseInt(A[j]) > Integer.parseInt(v)) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = v;
			System.out.println(String.join(" ",A)); 
		} {
			String v = A[i];
			j = i - 1;
			while (j >= 0 && Integer.parseInt(A[j]) > Integer.parseInt(v)) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = v;
			System.out.println(String.join(" ",A)); 
		} String v = A[i]; v A[i] A i j = i - 1 j i - 1 i 1 while (j >= 0 && Integer.parseInt(A[j]) > Integer.parseInt(v)) {
				A[j + 1] = A[j];
				j--;
			} j >= 0 && Integer.parseInt(A[j]) > Integer.parseInt(v) j >= 0 j 0 Integer.parseInt(A[j]) > Integer.parseInt(v) Integer.parseInt(A[j]) Integer.parseInt Integer A[j] A j Integer.parseInt(v) Integer.parseInt Integer v {
				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] = v A[j + 1] A j + 1 j 1 v System.out.println(String.join(" ",A)) System.out.println System.out System System.out String.join(" ",A) String.join String " " A String[] args args public class Main
{
	public static void main (String[] args) throws Exception
	{
		BufferedReader stdReader =
		new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(stdReader.readLine());
		String A[] = stdReader.readLine().split(" ",0);
		int j = 0;
		System.out.println(String.join(" ",A)); 
		for (int i = 1; i < N; i++) {
			String v = A[i];
			j = i - 1;
			while (j >= 0 && Integer.parseInt(A[j]) > Integer.parseInt(v)) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = v;
			System.out.println(String.join(" ",A)); 
		}
	}
} public class Main
{
	public static void main (String[] args) throws Exception
	{
		BufferedReader stdReader =
		new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(stdReader.readLine());
		String A[] = stdReader.readLine().split(" ",0);
		int j = 0;
		System.out.println(String.join(" ",A)); 
		for (int i = 1; i < N; i++) {
			String v = A[i];
			j = i - 1;
			while (j >= 0 && Integer.parseInt(A[j]) > Integer.parseInt(v)) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = v;
			System.out.println(String.join(" ",A)); 
		}
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
 
public class Main
{
	public static void main (String[] args) throws Exception
	{
		BufferedReader stdReader =
		new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(stdReader.readLine());
		String A[] = stdReader.readLine().split(" ",0);
		int j = 0;
		System.out.println(String.join(" ",A)); 
		for (int i = 1; i < N; i++) {
			String v = A[i];
			j = i - 1;
			while (j >= 0 && Integer.parseInt(A[j]) > Integer.parseInt(v)) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = v;
			System.out.println(String.join(" ",A)); 
		}
	}
}