import java.util.Scanner;

public class Main {
	public static void sort(int[] a,int i){
		int key=a[i];
		int j=i-1;
		while(j>=0 && a[j]>key){
			a[j+1]=a[j];
			j--;
		}
		a[j+1]=key;
	}
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] a=new int[n];
		for (int i=0;i<n;i++){
			a[i]=sc.nextInt();
		}
		for(int i=0;i<n;i++){
			sort(a,i);
			for(int k=0;k<n-1;k++){
				System.out.print(a[k]+" ");
			}
			System.out.println(a[n-1]);;
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void sort(int[] a,int i){
		int key=a[i];
		int j=i-1;
		while(j>=0 && a[j]>key){
			a[j+1]=a[j];
			j--;
		}
		a[j+1]=key;
	}
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] a=new int[n];
		for (int i=0;i<n;i++){
			a[i]=sc.nextInt();
		}
		for(int i=0;i<n;i++){
			sort(a,i);
			for(int k=0;k<n-1;k++){
				System.out.print(a[k]+" ");
			}
			System.out.println(a[n-1]);;
		}
	}
} Main public static void sort(int[] a,int i){
		int key=a[i];
		int j=i-1;
		while(j>=0 && a[j]>key){
			a[j+1]=a[j];
			j--;
		}
		a[j+1]=key;
	} sort {
		int key=a[i];
		int j=i-1;
		while(j>=0 && a[j]>key){
			a[j+1]=a[j];
			j--;
		}
		a[j+1]=key;
	} int key=a[i]; key a[i] a i int j=i-1; j i-1 i 1 while(j>=0 && a[j]>key){
			a[j+1]=a[j];
			j--;
		} j>=0 && a[j]>key j>=0 j 0 a[j]>key a[j] a j key {
			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]=key a[j+1] a j+1 j 1 key int[] a a int i i public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] a=new int[n];
		for (int i=0;i<n;i++){
			a[i]=sc.nextInt();
		}
		for(int i=0;i<n;i++){
			sort(a,i);
			for(int k=0;k<n-1;k++){
				System.out.print(a[k]+" ");
			}
			System.out.println(a[n-1]);;
		}
	} main {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] a=new int[n];
		for (int i=0;i<n;i++){
			a[i]=sc.nextInt();
		}
		for(int i=0;i<n;i++){
			sort(a,i);
			for(int k=0;k<n-1;k++){
				System.out.print(a[k]+" ");
			}
			System.out.println(a[n-1]);;
		}
	} Scanner sc=new Scanner(System.in); sc new 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]=sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc for(int i=0;i<n;i++){
			sort(a,i);
			for(int k=0;k<n-1;k++){
				System.out.print(a[k]+" ");
			}
			System.out.println(a[n-1]);;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			sort(a,i);
			for(int k=0;k<n-1;k++){
				System.out.print(a[k]+" ");
			}
			System.out.println(a[n-1]);;
		} {
			sort(a,i);
			for(int k=0;k<n-1;k++){
				System.out.print(a[k]+" ");
			}
			System.out.println(a[n-1]);;
		} sort(a,i) sort a i for(int k=0;k<n-1;k++){
				System.out.print(a[k]+" ");
			} int k=0; int k=0; k 0 k<n-1 k n-1 n 1 k++ k++ k {
				System.out.print(a[k]+" ");
			} {
				System.out.print(a[k]+" ");
			} System.out.print(a[k]+" ") System.out.print System.out System System.out a[k]+" " a[k] a k " " System.out.println(a[n-1]) System.out.println System.out System System.out a[n-1] a n-1 n 1 String[] args args public class Main {
	public static void sort(int[] a,int i){
		int key=a[i];
		int j=i-1;
		while(j>=0 && a[j]>key){
			a[j+1]=a[j];
			j--;
		}
		a[j+1]=key;
	}
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] a=new int[n];
		for (int i=0;i<n;i++){
			a[i]=sc.nextInt();
		}
		for(int i=0;i<n;i++){
			sort(a,i);
			for(int k=0;k<n-1;k++){
				System.out.print(a[k]+" ");
			}
			System.out.println(a[n-1]);;
		}
	}
} public class Main {
	public static void sort(int[] a,int i){
		int key=a[i];
		int j=i-1;
		while(j>=0 && a[j]>key){
			a[j+1]=a[j];
			j--;
		}
		a[j+1]=key;
	}
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] a=new int[n];
		for (int i=0;i<n;i++){
			a[i]=sc.nextInt();
		}
		for(int i=0;i<n;i++){
			sort(a,i);
			for(int k=0;k<n-1;k++){
				System.out.print(a[k]+" ");
			}
			System.out.println(a[n-1]);;
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void sort(int[] a,int i){
		int key=a[i];
		int j=i-1;
		while(j>=0 && a[j]>key){
			a[j+1]=a[j];
			j--;
		}
		a[j+1]=key;
	}
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] a=new int[n];
		for (int i=0;i<n;i++){
			a[i]=sc.nextInt();
		}
		for(int i=0;i<n;i++){
			sort(a,i);
			for(int k=0;k<n-1;k++){
				System.out.print(a[k]+" ");
			}
			System.out.println(a[n-1]);;
		}
	}
}