import java.util.Scanner;
class Main
{
	static void sort( int A[] )
	{
		putArray(A);
		int v, j;
		for( int i = 1 ; i < A.length ; i++ )
		{
			v = A[i];
			for( j = i-1 ; 0<=j && v<A[j] ; j-- )
				A[j+1] = A[j];
			A[j+1] = v;
			putArray(A);
		}
		return;
	}
	static void putArray( int A[] )
	{
		for( int i = 0 ; i < A.length ; i++ )
		{
			if( i==A.length-1 )
				System.out.print( A[i]+"\n" );
			else
				System.out.print( A[i]+" " );
		}
		return;
	}
	public static void main( String[] args )
	{
		Scanner sc = new java.util.Scanner( System.in );
		int n = sc.nextInt();
		int A[] = new int[n];
		for( int i = 0 ; i < n ; i++ )
			A[i] = sc.nextInt();
		sort( A );
		
		return;
	}
} import java.util.Scanner; Scanner java.util class Main
{
	static void sort( int A[] )
	{
		putArray(A);
		int v, j;
		for( int i = 1 ; i < A.length ; i++ )
		{
			v = A[i];
			for( j = i-1 ; 0<=j && v<A[j] ; j-- )
				A[j+1] = A[j];
			A[j+1] = v;
			putArray(A);
		}
		return;
	}
	static void putArray( int A[] )
	{
		for( int i = 0 ; i < A.length ; i++ )
		{
			if( i==A.length-1 )
				System.out.print( A[i]+"\n" );
			else
				System.out.print( A[i]+" " );
		}
		return;
	}
	public static void main( String[] args )
	{
		Scanner sc = new java.util.Scanner( System.in );
		int n = sc.nextInt();
		int A[] = new int[n];
		for( int i = 0 ; i < n ; i++ )
			A[i] = sc.nextInt();
		sort( A );
		
		return;
	}
} Main static void sort( int A[] )
	{
		putArray(A);
		int v, j;
		for( int i = 1 ; i < A.length ; i++ )
		{
			v = A[i];
			for( j = i-1 ; 0<=j && v<A[j] ; j-- )
				A[j+1] = A[j];
			A[j+1] = v;
			putArray(A);
		}
		return;
	} sort {
		putArray(A);
		int v, j;
		for( int i = 1 ; i < A.length ; i++ )
		{
			v = A[i];
			for( j = i-1 ; 0<=j && v<A[j] ; j-- )
				A[j+1] = A[j];
			A[j+1] = v;
			putArray(A);
		}
		return;
	} putArray(A) putArray A int v v j; j for( int i = 1 ; i < A.length ; i++ )
		{
			v = A[i];
			for( j = i-1 ; 0<=j && v<A[j] ; j-- )
				A[j+1] = A[j];
			A[j+1] = v;
			putArray(A);
		} int i = 1 ; int i = 1 ; i 1 i < A.length i A.length A A.length i++ i++ i {
			v = A[i];
			for( j = i-1 ; 0<=j && v<A[j] ; j-- )
				A[j+1] = A[j];
			A[j+1] = v;
			putArray(A);
		} {
			v = A[i];
			for( j = i-1 ; 0<=j && v<A[j] ; j-- )
				A[j+1] = A[j];
			A[j+1] = v;
			putArray(A);
		} v = A[i] v A[i] A i for( j = i-1 ; 0<=j && v<A[j] ; j-- )
				A[j+1] = A[j]; j = i-1 ; j = i-1 j i-1 i 1 0<=j && v<A[j] 0<=j 0 j v<A[j] v A[j] A j j-- j-- j A[j+1] = A[j]; A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j A[j+1] = v A[j+1] A j+1 j 1 v putArray(A) putArray A return; int A[] A static void putArray( int A[] )
	{
		for( int i = 0 ; i < A.length ; i++ )
		{
			if( i==A.length-1 )
				System.out.print( A[i]+"\n" );
			else
				System.out.print( A[i]+" " );
		}
		return;
	} putArray {
		for( int i = 0 ; i < A.length ; i++ )
		{
			if( i==A.length-1 )
				System.out.print( A[i]+"\n" );
			else
				System.out.print( A[i]+" " );
		}
		return;
	} for( int i = 0 ; i < A.length ; i++ )
		{
			if( i==A.length-1 )
				System.out.print( A[i]+"\n" );
			else
				System.out.print( A[i]+" " );
		} int i = 0 ; int i = 0 ; i 0 i < A.length i A.length A A.length i++ i++ i {
			if( i==A.length-1 )
				System.out.print( A[i]+"\n" );
			else
				System.out.print( A[i]+" " );
		} {
			if( i==A.length-1 )
				System.out.print( A[i]+"\n" );
			else
				System.out.print( A[i]+" " );
		} if( i==A.length-1 )
				System.out.print( A[i]+"\n" );
			else
				System.out.print( A[i]+" " ); i==A.length-1 i A.length-1 A.length A A.length 1 System.out.print( A[i]+"\n" ) System.out.print System.out System System.out A[i]+"\n" A[i] A i "\n" System.out.print( A[i]+" " ) System.out.print System.out System System.out A[i]+" " A[i] A i " " return; int A[] A public static void main( String[] args )
	{
		Scanner sc = new java.util.Scanner( System.in );
		int n = sc.nextInt();
		int A[] = new int[n];
		for( int i = 0 ; i < n ; i++ )
			A[i] = sc.nextInt();
		sort( A );
		
		return;
	} main {
		Scanner sc = new java.util.Scanner( System.in );
		int n = sc.nextInt();
		int A[] = new int[n];
		for( int i = 0 ; i < n ; i++ )
			A[i] = sc.nextInt();
		sort( A );
		
		return;
	} Scanner sc = new java.util.Scanner( System.in ); sc new java.util.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 sort( A ) sort A return; String[] args args
import java.util.Scanner;
class Main
{
	static void sort( int A[] )
	{
		putArray(A);
		int v, j;
		for( int i = 1 ; i < A.length ; i++ )
		{
			v = A[i];
			for( j = i-1 ; 0<=j && v<A[j] ; j-- )
				A[j+1] = A[j];
			A[j+1] = v;
			putArray(A);
		}
		return;
	}
	static void putArray( int A[] )
	{
		for( int i = 0 ; i < A.length ; i++ )
		{
			if( i==A.length-1 )
				System.out.print( A[i]+"\n" );
			else
				System.out.print( A[i]+" " );
		}
		return;
	}
	public static void main( String[] args )
	{
		Scanner sc = new java.util.Scanner( System.in );
		int n = sc.nextInt();
		int A[] = new int[n];
		for( int i = 0 ; i < n ; i++ )
			A[i] = sc.nextInt();
		sort( A );
		
		return;
	}
}