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[]){
		int n=100;
		int i,j,k,v,l;
		int a[]=new int[n+1];
		 Scanner sc = new Scanner(System.in);
		k=Integer.parseInt(sc.next());
		
		for(i=0;i<k;i++){
			a[i]=Integer.parseInt(sc.next());
		}
		for(i=0;i<k;i++){
			System.out.print(a[i]);
			if(i<k-1){
			System.out.print(" ");
			}
		}
		
		System.out.println();
		for(i=1;i<k;i++){
			v=a[i];
			j=i-1;
			while(j>=0&&a[j]>v){
				a[j+1]=a[j];
			
				j--;
			}
				a[j+1]=v;
			for(l=0;l<k;l++){
				System.out.print(a[l]);
				if(l<k-1){
				System.out.print(" ");
				}
			}
			System.out.println();
			
		}
		
	}
} 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[]){
		int n=100;
		int i,j,k,v,l;
		int a[]=new int[n+1];
		 Scanner sc = new Scanner(System.in);
		k=Integer.parseInt(sc.next());
		
		for(i=0;i<k;i++){
			a[i]=Integer.parseInt(sc.next());
		}
		for(i=0;i<k;i++){
			System.out.print(a[i]);
			if(i<k-1){
			System.out.print(" ");
			}
		}
		
		System.out.println();
		for(i=1;i<k;i++){
			v=a[i];
			j=i-1;
			while(j>=0&&a[j]>v){
				a[j+1]=a[j];
			
				j--;
			}
				a[j+1]=v;
			for(l=0;l<k;l++){
				System.out.print(a[l]);
				if(l<k-1){
				System.out.print(" ");
				}
			}
			System.out.println();
			
		}
		
	}
} Main public static void main(String args[]){
		int n=100;
		int i,j,k,v,l;
		int a[]=new int[n+1];
		 Scanner sc = new Scanner(System.in);
		k=Integer.parseInt(sc.next());
		
		for(i=0;i<k;i++){
			a[i]=Integer.parseInt(sc.next());
		}
		for(i=0;i<k;i++){
			System.out.print(a[i]);
			if(i<k-1){
			System.out.print(" ");
			}
		}
		
		System.out.println();
		for(i=1;i<k;i++){
			v=a[i];
			j=i-1;
			while(j>=0&&a[j]>v){
				a[j+1]=a[j];
			
				j--;
			}
				a[j+1]=v;
			for(l=0;l<k;l++){
				System.out.print(a[l]);
				if(l<k-1){
				System.out.print(" ");
				}
			}
			System.out.println();
			
		}
		
	} main {
		int n=100;
		int i,j,k,v,l;
		int a[]=new int[n+1];
		 Scanner sc = new Scanner(System.in);
		k=Integer.parseInt(sc.next());
		
		for(i=0;i<k;i++){
			a[i]=Integer.parseInt(sc.next());
		}
		for(i=0;i<k;i++){
			System.out.print(a[i]);
			if(i<k-1){
			System.out.print(" ");
			}
		}
		
		System.out.println();
		for(i=1;i<k;i++){
			v=a[i];
			j=i-1;
			while(j>=0&&a[j]>v){
				a[j+1]=a[j];
			
				j--;
			}
				a[j+1]=v;
			for(l=0;l<k;l++){
				System.out.print(a[l]);
				if(l<k-1){
				System.out.print(" ");
				}
			}
			System.out.println();
			
		}
		
	} int n=100; n 100 int i i j j k k v v l; l int a[]=new int[n+1]; a new int[n+1] n+1 n 1 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) k=Integer.parseInt(sc.next()) k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc for(i=0;i<k;i++){
			a[i]=Integer.parseInt(sc.next());
		} i=0; i=0 i 0 i<k i k i++ i++ i {
			a[i]=Integer.parseInt(sc.next());
		} {
			a[i]=Integer.parseInt(sc.next());
		} a[i]=Integer.parseInt(sc.next()) a[i] a i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc for(i=0;i<k;i++){
			System.out.print(a[i]);
			if(i<k-1){
			System.out.print(" ");
			}
		} i=0; i=0 i 0 i<k i k i++ i++ i {
			System.out.print(a[i]);
			if(i<k-1){
			System.out.print(" ");
			}
		} {
			System.out.print(a[i]);
			if(i<k-1){
			System.out.print(" ");
			}
		} System.out.print(a[i]) System.out.print System.out System System.out a[i] a i if(i<k-1){
			System.out.print(" ");
			} i<k-1 i k-1 k 1 {
			System.out.print(" ");
			} System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out for(i=1;i<k;i++){
			v=a[i];
			j=i-1;
			while(j>=0&&a[j]>v){
				a[j+1]=a[j];
			
				j--;
			}
				a[j+1]=v;
			for(l=0;l<k;l++){
				System.out.print(a[l]);
				if(l<k-1){
				System.out.print(" ");
				}
			}
			System.out.println();
			
		} i=1; i=1 i 1 i<k i k i++ i++ i {
			v=a[i];
			j=i-1;
			while(j>=0&&a[j]>v){
				a[j+1]=a[j];
			
				j--;
			}
				a[j+1]=v;
			for(l=0;l<k;l++){
				System.out.print(a[l]);
				if(l<k-1){
				System.out.print(" ");
				}
			}
			System.out.println();
			
		} {
			v=a[i];
			j=i-1;
			while(j>=0&&a[j]>v){
				a[j+1]=a[j];
			
				j--;
			}
				a[j+1]=v;
			for(l=0;l<k;l++){
				System.out.print(a[l]);
				if(l<k-1){
				System.out.print(" ");
				}
			}
			System.out.println();
			
		} v=a[i] v a[i] a i j=i-1 j i-1 i 1 while(j>=0&&a[j]>v){
				a[j+1]=a[j];
			
				j--;
			} j>=0&&a[j]>v j>=0 j 0 a[j]>v a[j] a j v {
				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]=v a[j+1] a j+1 j 1 v for(l=0;l<k;l++){
				System.out.print(a[l]);
				if(l<k-1){
				System.out.print(" ");
				}
			} l=0; l=0 l 0 l<k l k l++ l++ l {
				System.out.print(a[l]);
				if(l<k-1){
				System.out.print(" ");
				}
			} {
				System.out.print(a[l]);
				if(l<k-1){
				System.out.print(" ");
				}
			} System.out.print(a[l]) System.out.print System.out System System.out a[l] a l if(l<k-1){
				System.out.print(" ");
				} l<k-1 l k-1 k 1 {
				System.out.print(" ");
				} System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out String args[] args public class Main{

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

	public static void main(String args[]){
		int n=100;
		int i,j,k,v,l;
		int a[]=new int[n+1];
		 Scanner sc = new Scanner(System.in);
		k=Integer.parseInt(sc.next());
		
		for(i=0;i<k;i++){
			a[i]=Integer.parseInt(sc.next());
		}
		for(i=0;i<k;i++){
			System.out.print(a[i]);
			if(i<k-1){
			System.out.print(" ");
			}
		}
		
		System.out.println();
		for(i=1;i<k;i++){
			v=a[i];
			j=i-1;
			while(j>=0&&a[j]>v){
				a[j+1]=a[j];
			
				j--;
			}
				a[j+1]=v;
			for(l=0;l<k;l++){
				System.out.print(a[l]);
				if(l<k-1){
				System.out.print(" ");
				}
			}
			System.out.println();
			
		}
		
	}
} 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[]){
		int n=100;
		int i,j,k,v,l;
		int a[]=new int[n+1];
		 Scanner sc = new Scanner(System.in);
		k=Integer.parseInt(sc.next());
		
		for(i=0;i<k;i++){
			a[i]=Integer.parseInt(sc.next());
		}
		for(i=0;i<k;i++){
			System.out.print(a[i]);
			if(i<k-1){
			System.out.print(" ");
			}
		}
		
		System.out.println();
		for(i=1;i<k;i++){
			v=a[i];
			j=i-1;
			while(j>=0&&a[j]>v){
				a[j+1]=a[j];
			
				j--;
			}
				a[j+1]=v;
			for(l=0;l<k;l++){
				System.out.print(a[l]);
				if(l<k-1){
				System.out.print(" ");
				}
			}
			System.out.println();
			
		}
		
	}
}