import java.io.*;

public class Main
{
	public static void main(String[] args)
	{
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str = br.readLine().split(" ");
			int[] ar = new int[n];
			for(int i= 0 ; i< n ; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			gyalaxySort(ar,n);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	public static void gyalaxySort(int[] a, int len)
	{
		StringBuilder sb = new StringBuilder();
		sb.append(giganticBunshou(a,len));
		for(int i = 1 ; i < len ; i++)
		{
			int tar = a[i];
			int j = i - 1;
			while(j >= 0 && a[j] > tar )
			{
				a[j+1] =a[j]; 
				a[j] = tar;
				j--;
				
			}
			sb.append(giganticBunshou(a,len));
		}
		System.out.print(sb);
	}
	public static String giganticBunshou(int[] b, int l)
	{
		StringBuilder sb = new StringBuilder();
		for(int i=0 ; i<l-1 ; i++)
		{
			sb.append(b[i]).append(" ");
		}
		sb.append(b[l-1]).append("\n");
		return sb.toString();
	}
	
} import java.io.*; io.* java public class Main
{
	public static void main(String[] args)
	{
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str = br.readLine().split(" ");
			int[] ar = new int[n];
			for(int i= 0 ; i< n ; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			gyalaxySort(ar,n);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	public static void gyalaxySort(int[] a, int len)
	{
		StringBuilder sb = new StringBuilder();
		sb.append(giganticBunshou(a,len));
		for(int i = 1 ; i < len ; i++)
		{
			int tar = a[i];
			int j = i - 1;
			while(j >= 0 && a[j] > tar )
			{
				a[j+1] =a[j]; 
				a[j] = tar;
				j--;
				
			}
			sb.append(giganticBunshou(a,len));
		}
		System.out.print(sb);
	}
	public static String giganticBunshou(int[] b, int l)
	{
		StringBuilder sb = new StringBuilder();
		for(int i=0 ; i<l-1 ; i++)
		{
			sb.append(b[i]).append(" ");
		}
		sb.append(b[l-1]).append("\n");
		return sb.toString();
	}
	
} Main public static void main(String[] args)
	{
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str = br.readLine().split(" ");
			int[] ar = new int[n];
			for(int i= 0 ; i< n ; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			gyalaxySort(ar,n);
		}catch(Exception e){
			e.printStackTrace();
		}
	} main {
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str = br.readLine().split(" ");
			int[] ar = new int[n];
			for(int i= 0 ; i< n ; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			gyalaxySort(ar,n);
		}catch(Exception e){
			e.printStackTrace();
		}
	} try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str = br.readLine().split(" ");
			int[] ar = new int[n];
			for(int i= 0 ; i< n ; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			gyalaxySort(ar,n);
		}catch(Exception e){
			e.printStackTrace();
		} catch(Exception e){
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str = br.readLine().split(" ");
			int[] ar = new int[n];
			for(int i= 0 ; i< n ; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			gyalaxySort(ar,n);
		} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] ar = new int[n]; ar new int[n] n for(int i= 0 ; i< n ; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			} int i= 0 ; int i= 0 ; i 0 i< n i n i++ i++ i {
				ar[i] = Integer.parseInt(str[i]);
			} {
				ar[i] = Integer.parseInt(str[i]);
			} ar[i] = Integer.parseInt(str[i]) ar[i] ar i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i gyalaxySort(ar,n) gyalaxySort ar n String[] args args public static void gyalaxySort(int[] a, int len)
	{
		StringBuilder sb = new StringBuilder();
		sb.append(giganticBunshou(a,len));
		for(int i = 1 ; i < len ; i++)
		{
			int tar = a[i];
			int j = i - 1;
			while(j >= 0 && a[j] > tar )
			{
				a[j+1] =a[j]; 
				a[j] = tar;
				j--;
				
			}
			sb.append(giganticBunshou(a,len));
		}
		System.out.print(sb);
	} gyalaxySort {
		StringBuilder sb = new StringBuilder();
		sb.append(giganticBunshou(a,len));
		for(int i = 1 ; i < len ; i++)
		{
			int tar = a[i];
			int j = i - 1;
			while(j >= 0 && a[j] > tar )
			{
				a[j+1] =a[j]; 
				a[j] = tar;
				j--;
				
			}
			sb.append(giganticBunshou(a,len));
		}
		System.out.print(sb);
	} StringBuilder sb = new StringBuilder(); sb new StringBuilder() sb.append(giganticBunshou(a,len)) sb.append sb giganticBunshou(a,len) giganticBunshou a len for(int i = 1 ; i < len ; i++)
		{
			int tar = a[i];
			int j = i - 1;
			while(j >= 0 && a[j] > tar )
			{
				a[j+1] =a[j]; 
				a[j] = tar;
				j--;
				
			}
			sb.append(giganticBunshou(a,len));
		} int i = 1 ; int i = 1 ; i 1 i < len i len i++ i++ i {
			int tar = a[i];
			int j = i - 1;
			while(j >= 0 && a[j] > tar )
			{
				a[j+1] =a[j]; 
				a[j] = tar;
				j--;
				
			}
			sb.append(giganticBunshou(a,len));
		} {
			int tar = a[i];
			int j = i - 1;
			while(j >= 0 && a[j] > tar )
			{
				a[j+1] =a[j]; 
				a[j] = tar;
				j--;
				
			}
			sb.append(giganticBunshou(a,len));
		} int tar = a[i]; tar a[i] a i int j = i - 1; j i - 1 i 1 while(j >= 0 && a[j] > tar )
			{
				a[j+1] =a[j]; 
				a[j] = tar;
				j--;
				
			} j >= 0 && a[j] > tar j >= 0 j 0 a[j] > tar a[j] a j tar {
				a[j+1] =a[j]; 
				a[j] = tar;
				j--;
				
			} a[j+1] =a[j] a[j+1] a j+1 j 1 a[j] a j a[j] = tar a[j] a j tar j-- j sb.append(giganticBunshou(a,len)) sb.append sb giganticBunshou(a,len) giganticBunshou a len System.out.print(sb) System.out.print System.out System System.out sb int[] a a int len len public static String giganticBunshou(int[] b, int l)
	{
		StringBuilder sb = new StringBuilder();
		for(int i=0 ; i<l-1 ; i++)
		{
			sb.append(b[i]).append(" ");
		}
		sb.append(b[l-1]).append("\n");
		return sb.toString();
	} giganticBunshou {
		StringBuilder sb = new StringBuilder();
		for(int i=0 ; i<l-1 ; i++)
		{
			sb.append(b[i]).append(" ");
		}
		sb.append(b[l-1]).append("\n");
		return sb.toString();
	} StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i=0 ; i<l-1 ; i++)
		{
			sb.append(b[i]).append(" ");
		} int i=0 ; int i=0 ; i 0 i<l-1 i l-1 l 1 i++ i++ i {
			sb.append(b[i]).append(" ");
		} {
			sb.append(b[i]).append(" ");
		} sb.append(b[i]).append(" ") sb.append(b[i]).append sb.append(b[i]) sb.append sb b[i] b i " " sb.append(b[l-1]).append("\n") sb.append(b[l-1]).append sb.append(b[l-1]) sb.append sb b[l-1] b l-1 l 1 "\n" return sb.toString(); sb.toString() sb.toString sb int[] b b int l l public class Main
{
	public static void main(String[] args)
	{
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str = br.readLine().split(" ");
			int[] ar = new int[n];
			for(int i= 0 ; i< n ; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			gyalaxySort(ar,n);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	public static void gyalaxySort(int[] a, int len)
	{
		StringBuilder sb = new StringBuilder();
		sb.append(giganticBunshou(a,len));
		for(int i = 1 ; i < len ; i++)
		{
			int tar = a[i];
			int j = i - 1;
			while(j >= 0 && a[j] > tar )
			{
				a[j+1] =a[j]; 
				a[j] = tar;
				j--;
				
			}
			sb.append(giganticBunshou(a,len));
		}
		System.out.print(sb);
	}
	public static String giganticBunshou(int[] b, int l)
	{
		StringBuilder sb = new StringBuilder();
		for(int i=0 ; i<l-1 ; i++)
		{
			sb.append(b[i]).append(" ");
		}
		sb.append(b[l-1]).append("\n");
		return sb.toString();
	}
	
} public class Main
{
	public static void main(String[] args)
	{
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str = br.readLine().split(" ");
			int[] ar = new int[n];
			for(int i= 0 ; i< n ; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			gyalaxySort(ar,n);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	public static void gyalaxySort(int[] a, int len)
	{
		StringBuilder sb = new StringBuilder();
		sb.append(giganticBunshou(a,len));
		for(int i = 1 ; i < len ; i++)
		{
			int tar = a[i];
			int j = i - 1;
			while(j >= 0 && a[j] > tar )
			{
				a[j+1] =a[j]; 
				a[j] = tar;
				j--;
				
			}
			sb.append(giganticBunshou(a,len));
		}
		System.out.print(sb);
	}
	public static String giganticBunshou(int[] b, int l)
	{
		StringBuilder sb = new StringBuilder();
		for(int i=0 ; i<l-1 ; i++)
		{
			sb.append(b[i]).append(" ");
		}
		sb.append(b[l-1]).append("\n");
		return sb.toString();
	}
	
} Main
import java.io.*;

public class Main
{
	public static void main(String[] args)
	{
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(br.readLine());
			String[] str = br.readLine().split(" ");
			int[] ar = new int[n];
			for(int i= 0 ; i< n ; i++)
			{
				ar[i] = Integer.parseInt(str[i]);
			}
			gyalaxySort(ar,n);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	public static void gyalaxySort(int[] a, int len)
	{
		StringBuilder sb = new StringBuilder();
		sb.append(giganticBunshou(a,len));
		for(int i = 1 ; i < len ; i++)
		{
			int tar = a[i];
			int j = i - 1;
			while(j >= 0 && a[j] > tar )
			{
				a[j+1] =a[j]; 
				a[j] = tar;
				j--;
				
			}
			sb.append(giganticBunshou(a,len));
		}
		System.out.print(sb);
	}
	public static String giganticBunshou(int[] b, int l)
	{
		StringBuilder sb = new StringBuilder();
		for(int i=0 ; i<l-1 ; i++)
		{
			sb.append(b[i]).append(" ");
		}
		sb.append(b[l-1]).append("\n");
		return sb.toString();
	}
	
}