import java.util.Scanner;

public class Main
{
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		int[] A = new int[1001];
		int n, i, j, key;
		n = input.nextInt();
		for(i = 1; i <=n; i++)
		{
			A[i]=input.nextInt();
		}
		for(i = 1; i <= n; i++){
  			key = A[i];
  			j = i - 1;
  			while( j >= 0 && A[j] > key){
  				A[j+1] = A[j];
  				j--;
  			}
  			A[j+1] = key;
  			trace(A, n);
  		}
	}

	public static void trace(int A[], int n)
	{
		for(int i=1;i<=n;i++){
			if(i>1)System.out.print(" ");
			System.out.print(A[i]);
		}
		System.out.println();
	}
} import java.util.Scanner; Scanner java.util public class Main
{
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		int[] A = new int[1001];
		int n, i, j, key;
		n = input.nextInt();
		for(i = 1; i <=n; i++)
		{
			A[i]=input.nextInt();
		}
		for(i = 1; i <= n; i++){
  			key = A[i];
  			j = i - 1;
  			while( j >= 0 && A[j] > key){
  				A[j+1] = A[j];
  				j--;
  			}
  			A[j+1] = key;
  			trace(A, n);
  		}
	}

	public static void trace(int A[], int n)
	{
		for(int i=1;i<=n;i++){
			if(i>1)System.out.print(" ");
			System.out.print(A[i]);
		}
		System.out.println();
	}
} Main public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		int[] A = new int[1001];
		int n, i, j, key;
		n = input.nextInt();
		for(i = 1; i <=n; i++)
		{
			A[i]=input.nextInt();
		}
		for(i = 1; i <= n; i++){
  			key = A[i];
  			j = i - 1;
  			while( j >= 0 && A[j] > key){
  				A[j+1] = A[j];
  				j--;
  			}
  			A[j+1] = key;
  			trace(A, n);
  		}
	} main {
		Scanner input = new Scanner(System.in);
		int[] A = new int[1001];
		int n, i, j, key;
		n = input.nextInt();
		for(i = 1; i <=n; i++)
		{
			A[i]=input.nextInt();
		}
		for(i = 1; i <= n; i++){
  			key = A[i];
  			j = i - 1;
  			while( j >= 0 && A[j] > key){
  				A[j+1] = A[j];
  				j--;
  			}
  			A[j+1] = key;
  			trace(A, n);
  		}
	} Scanner input = new Scanner(System.in); input new Scanner(System.in) int[] A = new int[1001]; A new int[1001] 1001 int n n i i j j key; key n = input.nextInt() n input.nextInt() input.nextInt input for(i = 1; i <=n; i++)
		{
			A[i]=input.nextInt();
		} i = 1; i = 1 i 1 i <=n i n i++ i++ i {
			A[i]=input.nextInt();
		} {
			A[i]=input.nextInt();
		} A[i]=input.nextInt() A[i] A i input.nextInt() input.nextInt input for(i = 1; i <= n; i++){
  			key = A[i];
  			j = i - 1;
  			while( j >= 0 && A[j] > key){
  				A[j+1] = A[j];
  				j--;
  			}
  			A[j+1] = key;
  			trace(A, n);
  		} i = 1; i = 1 i 1 i <= n i n i++ i++ i {
  			key = A[i];
  			j = i - 1;
  			while( j >= 0 && A[j] > key){
  				A[j+1] = A[j];
  				j--;
  			}
  			A[j+1] = key;
  			trace(A, n);
  		} {
  			key = A[i];
  			j = i - 1;
  			while( j >= 0 && A[j] > key){
  				A[j+1] = A[j];
  				j--;
  			}
  			A[j+1] = key;
  			trace(A, n);
  		} key = A[i] key A[i] A i j = i - 1 j i - 1 i 1 while( j >= 0 && A[j] > key){
  				A[j+1] = A[j];
  				j--;
  			} j >= 0 && A[j] > key j >= 0 j 0 A[j] > key A[j] A j key {
  				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] = key A[j+1] A j+1 j 1 key trace(A, n) trace A n String args[] args public static void trace(int A[], int n)
	{
		for(int i=1;i<=n;i++){
			if(i>1)System.out.print(" ");
			System.out.print(A[i]);
		}
		System.out.println();
	} trace {
		for(int i=1;i<=n;i++){
			if(i>1)System.out.print(" ");
			System.out.print(A[i]);
		}
		System.out.println();
	} for(int i=1;i<=n;i++){
			if(i>1)System.out.print(" ");
			System.out.print(A[i]);
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			if(i>1)System.out.print(" ");
			System.out.print(A[i]);
		} {
			if(i>1)System.out.print(" ");
			System.out.print(A[i]);
		} if(i>1)System.out.print(" "); i>1 i 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.print(A[i]) System.out.print System.out System System.out A[i] A i System.out.println() System.out.println System.out System System.out int A[] A int n n public class Main
{
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		int[] A = new int[1001];
		int n, i, j, key;
		n = input.nextInt();
		for(i = 1; i <=n; i++)
		{
			A[i]=input.nextInt();
		}
		for(i = 1; i <= n; i++){
  			key = A[i];
  			j = i - 1;
  			while( j >= 0 && A[j] > key){
  				A[j+1] = A[j];
  				j--;
  			}
  			A[j+1] = key;
  			trace(A, n);
  		}
	}

	public static void trace(int A[], int n)
	{
		for(int i=1;i<=n;i++){
			if(i>1)System.out.print(" ");
			System.out.print(A[i]);
		}
		System.out.println();
	}
} public class Main
{
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		int[] A = new int[1001];
		int n, i, j, key;
		n = input.nextInt();
		for(i = 1; i <=n; i++)
		{
			A[i]=input.nextInt();
		}
		for(i = 1; i <= n; i++){
  			key = A[i];
  			j = i - 1;
  			while( j >= 0 && A[j] > key){
  				A[j+1] = A[j];
  				j--;
  			}
  			A[j+1] = key;
  			trace(A, n);
  		}
	}

	public static void trace(int A[], int n)
	{
		for(int i=1;i<=n;i++){
			if(i>1)System.out.print(" ");
			System.out.print(A[i]);
		}
		System.out.println();
	}
} Main
import java.util.Scanner;

public class Main
{
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		int[] A = new int[1001];
		int n, i, j, key;
		n = input.nextInt();
		for(i = 1; i <=n; i++)
		{
			A[i]=input.nextInt();
		}
		for(i = 1; i <= n; i++){
  			key = A[i];
  			j = i - 1;
  			while( j >= 0 && A[j] > key){
  				A[j+1] = A[j];
  				j--;
  			}
  			A[j+1] = key;
  			trace(A, n);
  		}
	}

	public static void trace(int A[], int n)
	{
		for(int i=1;i<=n;i++){
			if(i>1)System.out.print(" ");
			System.out.print(A[i]);
		}
		System.out.println();
	}
}