import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=Integer.valueOf(sc.next());
		int[] arr= new int[n];
		for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		}
		sc.close();
		for(int i=1;i<n;i++){
			print(arr);
			int t=arr[i];
			int j=i-1;
			while(j>=0&&t<arr[j]){
				arr[j+1]=arr[j];
				j--;
			}
			arr[j+1]=t;
		}
		print(arr);
	}
	public static void print(int[] arr){
		System.out.print(arr[0]);
		for(int i= 1;i<arr.length;i++)
			System.out.print(" "+arr[i]);

		System.out.println();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=Integer.valueOf(sc.next());
		int[] arr= new int[n];
		for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		}
		sc.close();
		for(int i=1;i<n;i++){
			print(arr);
			int t=arr[i];
			int j=i-1;
			while(j>=0&&t<arr[j]){
				arr[j+1]=arr[j];
				j--;
			}
			arr[j+1]=t;
		}
		print(arr);
	}
	public static void print(int[] arr){
		System.out.print(arr[0]);
		for(int i= 1;i<arr.length;i++)
			System.out.print(" "+arr[i]);

		System.out.println();
	}
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=Integer.valueOf(sc.next());
		int[] arr= new int[n];
		for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		}
		sc.close();
		for(int i=1;i<n;i++){
			print(arr);
			int t=arr[i];
			int j=i-1;
			while(j>=0&&t<arr[j]){
				arr[j+1]=arr[j];
				j--;
			}
			arr[j+1]=t;
		}
		print(arr);
	} main {
		Scanner sc=new Scanner(System.in);
		int n=Integer.valueOf(sc.next());
		int[] arr= new int[n];
		for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		}
		sc.close();
		for(int i=1;i<n;i++){
			print(arr);
			int t=arr[i];
			int j=i-1;
			while(j>=0&&t<arr[j]){
				arr[j+1]=arr[j];
				j--;
			}
			arr[j+1]=t;
		}
		print(arr);
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=Integer.valueOf(sc.next()); n Integer.valueOf(sc.next()) Integer.valueOf Integer sc.next() sc.next sc int[] arr= new int[n]; arr new int[n] n for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			arr[i]=Integer.valueOf(sc.next());
		} {
			arr[i]=Integer.valueOf(sc.next());
		} arr[i]=Integer.valueOf(sc.next()) arr[i] arr i Integer.valueOf(sc.next()) Integer.valueOf Integer sc.next() sc.next sc sc.close() sc.close sc for(int i=1;i<n;i++){
			print(arr);
			int t=arr[i];
			int j=i-1;
			while(j>=0&&t<arr[j]){
				arr[j+1]=arr[j];
				j--;
			}
			arr[j+1]=t;
		} int i=1; int i=1; i 1 i<n i n i++ i++ i {
			print(arr);
			int t=arr[i];
			int j=i-1;
			while(j>=0&&t<arr[j]){
				arr[j+1]=arr[j];
				j--;
			}
			arr[j+1]=t;
		} {
			print(arr);
			int t=arr[i];
			int j=i-1;
			while(j>=0&&t<arr[j]){
				arr[j+1]=arr[j];
				j--;
			}
			arr[j+1]=t;
		} print(arr) print arr int t=arr[i]; t arr[i] arr i int j=i-1; j i-1 i 1 while(j>=0&&t<arr[j]){
				arr[j+1]=arr[j];
				j--;
			} j>=0&&t<arr[j] j>=0 j 0 t<arr[j] t arr[j] arr j {
				arr[j+1]=arr[j];
				j--;
			} arr[j+1]=arr[j] arr[j+1] arr j+1 j 1 arr[j] arr j j-- j arr[j+1]=t arr[j+1] arr j+1 j 1 t print(arr) print arr String[] args args public static void print(int[] arr){
		System.out.print(arr[0]);
		for(int i= 1;i<arr.length;i++)
			System.out.print(" "+arr[i]);

		System.out.println();
	} print {
		System.out.print(arr[0]);
		for(int i= 1;i<arr.length;i++)
			System.out.print(" "+arr[i]);

		System.out.println();
	} System.out.print(arr[0]) System.out.print System.out System System.out arr[0] arr 0 for(int i= 1;i<arr.length;i++)
			System.out.print(" "+arr[i]); int i= 1; int i= 1; i 1 i<arr.length i arr.length arr arr.length i++ i++ i System.out.print(" "+arr[i]); System.out.print(" "+arr[i]) System.out.print System.out System System.out " "+arr[i] " " arr[i] arr i System.out.println() System.out.println System.out System System.out int[] arr arr public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=Integer.valueOf(sc.next());
		int[] arr= new int[n];
		for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		}
		sc.close();
		for(int i=1;i<n;i++){
			print(arr);
			int t=arr[i];
			int j=i-1;
			while(j>=0&&t<arr[j]){
				arr[j+1]=arr[j];
				j--;
			}
			arr[j+1]=t;
		}
		print(arr);
	}
	public static void print(int[] arr){
		System.out.print(arr[0]);
		for(int i= 1;i<arr.length;i++)
			System.out.print(" "+arr[i]);

		System.out.println();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=Integer.valueOf(sc.next());
		int[] arr= new int[n];
		for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		}
		sc.close();
		for(int i=1;i<n;i++){
			print(arr);
			int t=arr[i];
			int j=i-1;
			while(j>=0&&t<arr[j]){
				arr[j+1]=arr[j];
				j--;
			}
			arr[j+1]=t;
		}
		print(arr);
	}
	public static void print(int[] arr){
		System.out.print(arr[0]);
		for(int i= 1;i<arr.length;i++)
			System.out.print(" "+arr[i]);

		System.out.println();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=Integer.valueOf(sc.next());
		int[] arr= new int[n];
		for(int i=0;i<n;i++){
			arr[i]=Integer.valueOf(sc.next());
		}
		sc.close();
		for(int i=1;i<n;i++){
			print(arr);
			int t=arr[i];
			int j=i-1;
			while(j>=0&&t<arr[j]){
				arr[j+1]=arr[j];
				j--;
			}
			arr[j+1]=t;
		}
		print(arr);
	}
	public static void print(int[] arr){
		System.out.print(arr[0]);
		for(int i= 1;i<arr.length;i++)
			System.out.print(" "+arr[i]);

		System.out.println();
	}
}