import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.lang.Math.*;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
        int n,i,j,v;
        Scanner scan=new Scanner(System.in);
        n=scan.nextInt();
        int m[]=new int[n];
        int k[]=new int[n];
        for(i=0;i<m.length;i++)
        {
        	m[i]=scan.nextInt();
        }
        
        for(i=0;i<m.length-1;i++)
        {
        	System.out.print(m[i]+" ");
        }
        System.out.println(m[n-1]);
        for(i=1;i<=m.length-1;i++)
        {
        	v=m[i];
        	j=i-1;
        	while(j>=0&&m[j]>v)
        	{
        		m[j+1]=m[j];
        		j--;
        	}
        	m[j+1]=v;
        	for(j=0;j<m.length-1;j++)
        	{
        		System.out.print(m[j]+" ");
        	}
        	System.out.println(m[n-1]);
        }
	}
} import java.util.*; util.* java import java.io.*; io.* java import static java.util.Arrays.*; import static java.util.Arrays.*; import static java.util.Arrays.*; import static java.util.Collections.*; import static java.util.Collections.*; import static java.util.Collections.*; import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
        int n,i,j,v;
        Scanner scan=new Scanner(System.in);
        n=scan.nextInt();
        int m[]=new int[n];
        int k[]=new int[n];
        for(i=0;i<m.length;i++)
        {
        	m[i]=scan.nextInt();
        }
        
        for(i=0;i<m.length-1;i++)
        {
        	System.out.print(m[i]+" ");
        }
        System.out.println(m[n-1]);
        for(i=1;i<=m.length-1;i++)
        {
        	v=m[i];
        	j=i-1;
        	while(j>=0&&m[j]>v)
        	{
        		m[j+1]=m[j];
        		j--;
        	}
        	m[j+1]=v;
        	for(j=0;j<m.length-1;j++)
        	{
        		System.out.print(m[j]+" ");
        	}
        	System.out.println(m[n-1]);
        }
	}
} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
        int n,i,j,v;
        Scanner scan=new Scanner(System.in);
        n=scan.nextInt();
        int m[]=new int[n];
        int k[]=new int[n];
        for(i=0;i<m.length;i++)
        {
        	m[i]=scan.nextInt();
        }
        
        for(i=0;i<m.length-1;i++)
        {
        	System.out.print(m[i]+" ");
        }
        System.out.println(m[n-1]);
        for(i=1;i<=m.length-1;i++)
        {
        	v=m[i];
        	j=i-1;
        	while(j>=0&&m[j]>v)
        	{
        		m[j+1]=m[j];
        		j--;
        	}
        	m[j+1]=v;
        	for(j=0;j<m.length-1;j++)
        	{
        		System.out.print(m[j]+" ");
        	}
        	System.out.println(m[n-1]);
        }
	} main {
		// TODO ?????????????????????????????????????????????
        int n,i,j,v;
        Scanner scan=new Scanner(System.in);
        n=scan.nextInt();
        int m[]=new int[n];
        int k[]=new int[n];
        for(i=0;i<m.length;i++)
        {
        	m[i]=scan.nextInt();
        }
        
        for(i=0;i<m.length-1;i++)
        {
        	System.out.print(m[i]+" ");
        }
        System.out.println(m[n-1]);
        for(i=1;i<=m.length-1;i++)
        {
        	v=m[i];
        	j=i-1;
        	while(j>=0&&m[j]>v)
        	{
        		m[j+1]=m[j];
        		j--;
        	}
        	m[j+1]=v;
        	for(j=0;j<m.length-1;j++)
        	{
        		System.out.print(m[j]+" ");
        	}
        	System.out.println(m[n-1]);
        }
	} int n n i i j j v; v Scanner scan=new Scanner(System.in); scan new Scanner(System.in) n=scan.nextInt() n scan.nextInt() scan.nextInt scan int m[]=new int[n]; m new int[n] n int k[]=new int[n]; k new int[n] n for(i=0;i<m.length;i++)
        {
        	m[i]=scan.nextInt();
        } i=0; i=0 i 0 i<m.length i m.length m m.length i++ i++ i {
        	m[i]=scan.nextInt();
        } {
        	m[i]=scan.nextInt();
        } m[i]=scan.nextInt() m[i] m i scan.nextInt() scan.nextInt scan for(i=0;i<m.length-1;i++)
        {
        	System.out.print(m[i]+" ");
        } i=0; i=0 i 0 i<m.length-1 i m.length-1 m.length m m.length 1 i++ i++ i {
        	System.out.print(m[i]+" ");
        } {
        	System.out.print(m[i]+" ");
        } System.out.print(m[i]+" ") System.out.print System.out System System.out m[i]+" " m[i] m i " " System.out.println(m[n-1]) System.out.println System.out System System.out m[n-1] m n-1 n 1 for(i=1;i<=m.length-1;i++)
        {
        	v=m[i];
        	j=i-1;
        	while(j>=0&&m[j]>v)
        	{
        		m[j+1]=m[j];
        		j--;
        	}
        	m[j+1]=v;
        	for(j=0;j<m.length-1;j++)
        	{
        		System.out.print(m[j]+" ");
        	}
        	System.out.println(m[n-1]);
        } i=1; i=1 i 1 i<=m.length-1 i m.length-1 m.length m m.length 1 i++ i++ i {
        	v=m[i];
        	j=i-1;
        	while(j>=0&&m[j]>v)
        	{
        		m[j+1]=m[j];
        		j--;
        	}
        	m[j+1]=v;
        	for(j=0;j<m.length-1;j++)
        	{
        		System.out.print(m[j]+" ");
        	}
        	System.out.println(m[n-1]);
        } {
        	v=m[i];
        	j=i-1;
        	while(j>=0&&m[j]>v)
        	{
        		m[j+1]=m[j];
        		j--;
        	}
        	m[j+1]=v;
        	for(j=0;j<m.length-1;j++)
        	{
        		System.out.print(m[j]+" ");
        	}
        	System.out.println(m[n-1]);
        } v=m[i] v m[i] m i j=i-1 j i-1 i 1 while(j>=0&&m[j]>v)
        	{
        		m[j+1]=m[j];
        		j--;
        	} j>=0&&m[j]>v j>=0 j 0 m[j]>v m[j] m j v {
        		m[j+1]=m[j];
        		j--;
        	} m[j+1]=m[j] m[j+1] m j+1 j 1 m[j] m j j-- j m[j+1]=v m[j+1] m j+1 j 1 v for(j=0;j<m.length-1;j++)
        	{
        		System.out.print(m[j]+" ");
        	} j=0; j=0 j 0 j<m.length-1 j m.length-1 m.length m m.length 1 j++ j++ j {
        		System.out.print(m[j]+" ");
        	} {
        		System.out.print(m[j]+" ");
        	} System.out.print(m[j]+" ") System.out.print System.out System System.out m[j]+" " m[j] m j " " System.out.println(m[n-1]) System.out.println System.out System System.out m[n-1] m n-1 n 1 String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
        int n,i,j,v;
        Scanner scan=new Scanner(System.in);
        n=scan.nextInt();
        int m[]=new int[n];
        int k[]=new int[n];
        for(i=0;i<m.length;i++)
        {
        	m[i]=scan.nextInt();
        }
        
        for(i=0;i<m.length-1;i++)
        {
        	System.out.print(m[i]+" ");
        }
        System.out.println(m[n-1]);
        for(i=1;i<=m.length-1;i++)
        {
        	v=m[i];
        	j=i-1;
        	while(j>=0&&m[j]>v)
        	{
        		m[j+1]=m[j];
        		j--;
        	}
        	m[j+1]=v;
        	for(j=0;j<m.length-1;j++)
        	{
        		System.out.print(m[j]+" ");
        	}
        	System.out.println(m[n-1]);
        }
	}
} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
        int n,i,j,v;
        Scanner scan=new Scanner(System.in);
        n=scan.nextInt();
        int m[]=new int[n];
        int k[]=new int[n];
        for(i=0;i<m.length;i++)
        {
        	m[i]=scan.nextInt();
        }
        
        for(i=0;i<m.length-1;i++)
        {
        	System.out.print(m[i]+" ");
        }
        System.out.println(m[n-1]);
        for(i=1;i<=m.length-1;i++)
        {
        	v=m[i];
        	j=i-1;
        	while(j>=0&&m[j]>v)
        	{
        		m[j+1]=m[j];
        		j--;
        	}
        	m[j+1]=v;
        	for(j=0;j<m.length-1;j++)
        	{
        		System.out.print(m[j]+" ");
        	}
        	System.out.println(m[n-1]);
        }
	}
} Main
import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.lang.Math.*;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
        int n,i,j,v;
        Scanner scan=new Scanner(System.in);
        n=scan.nextInt();
        int m[]=new int[n];
        int k[]=new int[n];
        for(i=0;i<m.length;i++)
        {
        	m[i]=scan.nextInt();
        }
        
        for(i=0;i<m.length-1;i++)
        {
        	System.out.print(m[i]+" ");
        }
        System.out.println(m[n-1]);
        for(i=1;i<=m.length-1;i++)
        {
        	v=m[i];
        	j=i-1;
        	while(j>=0&&m[j]>v)
        	{
        		m[j+1]=m[j];
        		j--;
        	}
        	m[j+1]=v;
        	for(j=0;j<m.length-1;j++)
        	{
        		System.out.print(m[j]+" ");
        	}
        	System.out.println(m[n-1]);
        }
	}
}