import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
	Scanner In = new Scanner(System.in);
	int N;
	do
	    {
		 N = In.nextInt();
	    }while(1 >= N && N >= 100);
	int i,j;
	int []A = new int[N];
		for(i = 0; i < N; i++)
		    {
			do
			    {
				A[i] = In.nextInt();
			    }while(0 >= A[i] && A[i] >= 1000);
		    }
 
	for(i = 1; i <= N - 1; i++)
	    {
		int v = A[i];
		j = i - 1;
		for(int m = 0; m < N - 1; m++)
		    System.out.print(A[m] + " ");
		System.out.print(A[N - 1]);
		System.out.println();

		while(j >= 0 && A[j] > v)
		    {
			A[j + 1] = A[j];
			j--;
			
		    }
		A[j + 1] = v;
		
	    }
	for(int l = 0; l < N - 1; l++)
		    System.out.print(A[l] + " ");
		
		System.out.print(A[N - 1]);
		System.out.println();
    }
} import java.util.Scanner; Scanner java.util public class Main
{
    public static void main(String[] args)
    {
	Scanner In = new Scanner(System.in);
	int N;
	do
	    {
		 N = In.nextInt();
	    }while(1 >= N && N >= 100);
	int i,j;
	int []A = new int[N];
		for(i = 0; i < N; i++)
		    {
			do
			    {
				A[i] = In.nextInt();
			    }while(0 >= A[i] && A[i] >= 1000);
		    }
 
	for(i = 1; i <= N - 1; i++)
	    {
		int v = A[i];
		j = i - 1;
		for(int m = 0; m < N - 1; m++)
		    System.out.print(A[m] + " ");
		System.out.print(A[N - 1]);
		System.out.println();

		while(j >= 0 && A[j] > v)
		    {
			A[j + 1] = A[j];
			j--;
			
		    }
		A[j + 1] = v;
		
	    }
	for(int l = 0; l < N - 1; l++)
		    System.out.print(A[l] + " ");
		
		System.out.print(A[N - 1]);
		System.out.println();
    }
} Main public static void main(String[] args)
    {
	Scanner In = new Scanner(System.in);
	int N;
	do
	    {
		 N = In.nextInt();
	    }while(1 >= N && N >= 100);
	int i,j;
	int []A = new int[N];
		for(i = 0; i < N; i++)
		    {
			do
			    {
				A[i] = In.nextInt();
			    }while(0 >= A[i] && A[i] >= 1000);
		    }
 
	for(i = 1; i <= N - 1; i++)
	    {
		int v = A[i];
		j = i - 1;
		for(int m = 0; m < N - 1; m++)
		    System.out.print(A[m] + " ");
		System.out.print(A[N - 1]);
		System.out.println();

		while(j >= 0 && A[j] > v)
		    {
			A[j + 1] = A[j];
			j--;
			
		    }
		A[j + 1] = v;
		
	    }
	for(int l = 0; l < N - 1; l++)
		    System.out.print(A[l] + " ");
		
		System.out.print(A[N - 1]);
		System.out.println();
    } main {
	Scanner In = new Scanner(System.in);
	int N;
	do
	    {
		 N = In.nextInt();
	    }while(1 >= N && N >= 100);
	int i,j;
	int []A = new int[N];
		for(i = 0; i < N; i++)
		    {
			do
			    {
				A[i] = In.nextInt();
			    }while(0 >= A[i] && A[i] >= 1000);
		    }
 
	for(i = 1; i <= N - 1; i++)
	    {
		int v = A[i];
		j = i - 1;
		for(int m = 0; m < N - 1; m++)
		    System.out.print(A[m] + " ");
		System.out.print(A[N - 1]);
		System.out.println();

		while(j >= 0 && A[j] > v)
		    {
			A[j + 1] = A[j];
			j--;
			
		    }
		A[j + 1] = v;
		
	    }
	for(int l = 0; l < N - 1; l++)
		    System.out.print(A[l] + " ");
		
		System.out.print(A[N - 1]);
		System.out.println();
    } Scanner In = new Scanner(System.in); In new Scanner(System.in) int N; N do
	    {
		 N = In.nextInt();
	    }while(1 >= N && N >= 100); 1 >= N && N >= 100 1 >= N 1 N N >= 100 N 100 {
		 N = In.nextInt();
	    } N = In.nextInt() N In.nextInt() In.nextInt In int i i j; j int []A = new int[N]; A new int[N] N for(i = 0; i < N; i++)
		    {
			do
			    {
				A[i] = In.nextInt();
			    }while(0 >= A[i] && A[i] >= 1000);
		    } i = 0; i = 0 i 0 i < N i N i++ i++ i {
			do
			    {
				A[i] = In.nextInt();
			    }while(0 >= A[i] && A[i] >= 1000);
		    } {
			do
			    {
				A[i] = In.nextInt();
			    }while(0 >= A[i] && A[i] >= 1000);
		    } do
			    {
				A[i] = In.nextInt();
			    }while(0 >= A[i] && A[i] >= 1000); 0 >= A[i] && A[i] >= 1000 0 >= A[i] 0 A[i] A i A[i] >= 1000 A[i] A i 1000 {
				A[i] = In.nextInt();
			    } A[i] = In.nextInt() A[i] A i In.nextInt() In.nextInt In for(i = 1; i <= N - 1; i++)
	    {
		int v = A[i];
		j = i - 1;
		for(int m = 0; m < N - 1; m++)
		    System.out.print(A[m] + " ");
		System.out.print(A[N - 1]);
		System.out.println();

		while(j >= 0 && A[j] > v)
		    {
			A[j + 1] = A[j];
			j--;
			
		    }
		A[j + 1] = v;
		
	    } i = 1; i = 1 i 1 i <= N - 1 i N - 1 N 1 i++ i++ i {
		int v = A[i];
		j = i - 1;
		for(int m = 0; m < N - 1; m++)
		    System.out.print(A[m] + " ");
		System.out.print(A[N - 1]);
		System.out.println();

		while(j >= 0 && A[j] > v)
		    {
			A[j + 1] = A[j];
			j--;
			
		    }
		A[j + 1] = v;
		
	    } {
		int v = A[i];
		j = i - 1;
		for(int m = 0; m < N - 1; m++)
		    System.out.print(A[m] + " ");
		System.out.print(A[N - 1]);
		System.out.println();

		while(j >= 0 && A[j] > v)
		    {
			A[j + 1] = A[j];
			j--;
			
		    }
		A[j + 1] = v;
		
	    } int v = A[i]; v A[i] A i j = i - 1 j i - 1 i 1 for(int m = 0; m < N - 1; m++)
		    System.out.print(A[m] + " "); int m = 0; int m = 0; m 0 m < N - 1 m N - 1 N 1 m++ m++ m System.out.print(A[m] + " "); System.out.print(A[m] + " ") System.out.print System.out System System.out A[m] + " " A[m] A m " " System.out.print(A[N - 1]) System.out.print System.out System System.out A[N - 1] A N - 1 N 1 System.out.println() System.out.println System.out System System.out while(j >= 0 && A[j] > v)
		    {
			A[j + 1] = A[j];
			j--;
			
		    } j >= 0 && A[j] > v j >= 0 j 0 A[j] > v A[j] A j 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 for(int l = 0; l < N - 1; l++)
		    System.out.print(A[l] + " "); int l = 0; int l = 0; l 0 l < N - 1 l N - 1 N 1 l++ l++ l System.out.print(A[l] + " "); System.out.print(A[l] + " ") System.out.print System.out System System.out A[l] + " " A[l] A l " " System.out.print(A[N - 1]) System.out.print System.out System System.out A[N - 1] A N - 1 N 1 System.out.println() System.out.println System.out System System.out String[] args args public class Main
{
    public static void main(String[] args)
    {
	Scanner In = new Scanner(System.in);
	int N;
	do
	    {
		 N = In.nextInt();
	    }while(1 >= N && N >= 100);
	int i,j;
	int []A = new int[N];
		for(i = 0; i < N; i++)
		    {
			do
			    {
				A[i] = In.nextInt();
			    }while(0 >= A[i] && A[i] >= 1000);
		    }
 
	for(i = 1; i <= N - 1; i++)
	    {
		int v = A[i];
		j = i - 1;
		for(int m = 0; m < N - 1; m++)
		    System.out.print(A[m] + " ");
		System.out.print(A[N - 1]);
		System.out.println();

		while(j >= 0 && A[j] > v)
		    {
			A[j + 1] = A[j];
			j--;
			
		    }
		A[j + 1] = v;
		
	    }
	for(int l = 0; l < N - 1; l++)
		    System.out.print(A[l] + " ");
		
		System.out.print(A[N - 1]);
		System.out.println();
    }
} public class Main
{
    public static void main(String[] args)
    {
	Scanner In = new Scanner(System.in);
	int N;
	do
	    {
		 N = In.nextInt();
	    }while(1 >= N && N >= 100);
	int i,j;
	int []A = new int[N];
		for(i = 0; i < N; i++)
		    {
			do
			    {
				A[i] = In.nextInt();
			    }while(0 >= A[i] && A[i] >= 1000);
		    }
 
	for(i = 1; i <= N - 1; i++)
	    {
		int v = A[i];
		j = i - 1;
		for(int m = 0; m < N - 1; m++)
		    System.out.print(A[m] + " ");
		System.out.print(A[N - 1]);
		System.out.println();

		while(j >= 0 && A[j] > v)
		    {
			A[j + 1] = A[j];
			j--;
			
		    }
		A[j + 1] = v;
		
	    }
	for(int l = 0; l < N - 1; l++)
		    System.out.print(A[l] + " ");
		
		System.out.print(A[N - 1]);
		System.out.println();
    }
} Main
import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
	Scanner In = new Scanner(System.in);
	int N;
	do
	    {
		 N = In.nextInt();
	    }while(1 >= N && N >= 100);
	int i,j;
	int []A = new int[N];
		for(i = 0; i < N; i++)
		    {
			do
			    {
				A[i] = In.nextInt();
			    }while(0 >= A[i] && A[i] >= 1000);
		    }
 
	for(i = 1; i <= N - 1; i++)
	    {
		int v = A[i];
		j = i - 1;
		for(int m = 0; m < N - 1; m++)
		    System.out.print(A[m] + " ");
		System.out.print(A[N - 1]);
		System.out.println();

		while(j >= 0 && A[j] > v)
		    {
			A[j + 1] = A[j];
			j--;
			
		    }
		A[j + 1] = v;
		
	    }
	for(int l = 0; l < N - 1; l++)
		    System.out.print(A[l] + " ");
		
		System.out.print(A[N - 1]);
		System.out.println();
    }
}