import java.util.Scanner;
class Main {
	public static void main(String[] args){
		final int Number=100;
		try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			int[] A = new int[N];
			for(int i=0;i<N;i++)A[i]=Integer.parseInt(sc.next());
			System.out.print(A[0]);
			for(int j=1;j<N;j++)System.out.print(" "+A[j]);
			System.out.println();
			for(int i=1;i<N;i++){
				int v = A[i];
				for(int j = i-1;(j>=0)&&(A[j]>v);j--){
					A[j+1]=A[j];
					A[j]=v;
				}
				
				System.out.print(A[0]);
				for(int j=1;j<N;j++)System.out.print(" "+A[j]);
				System.out.println();
			}
		}
	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args){
		final int Number=100;
		try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			int[] A = new int[N];
			for(int i=0;i<N;i++)A[i]=Integer.parseInt(sc.next());
			System.out.print(A[0]);
			for(int j=1;j<N;j++)System.out.print(" "+A[j]);
			System.out.println();
			for(int i=1;i<N;i++){
				int v = A[i];
				for(int j = i-1;(j>=0)&&(A[j]>v);j--){
					A[j+1]=A[j];
					A[j]=v;
				}
				
				System.out.print(A[0]);
				for(int j=1;j<N;j++)System.out.print(" "+A[j]);
				System.out.println();
			}
		}
	}
} Main public static void main(String[] args){
		final int Number=100;
		try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			int[] A = new int[N];
			for(int i=0;i<N;i++)A[i]=Integer.parseInt(sc.next());
			System.out.print(A[0]);
			for(int j=1;j<N;j++)System.out.print(" "+A[j]);
			System.out.println();
			for(int i=1;i<N;i++){
				int v = A[i];
				for(int j = i-1;(j>=0)&&(A[j]>v);j--){
					A[j+1]=A[j];
					A[j]=v;
				}
				
				System.out.print(A[0]);
				for(int j=1;j<N;j++)System.out.print(" "+A[j]);
				System.out.println();
			}
		}
	} main {
		final int Number=100;
		try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			int[] A = new int[N];
			for(int i=0;i<N;i++)A[i]=Integer.parseInt(sc.next());
			System.out.print(A[0]);
			for(int j=1;j<N;j++)System.out.print(" "+A[j]);
			System.out.println();
			for(int i=1;i<N;i++){
				int v = A[i];
				for(int j = i-1;(j>=0)&&(A[j]>v);j--){
					A[j+1]=A[j];
					A[j]=v;
				}
				
				System.out.print(A[0]);
				for(int j=1;j<N;j++)System.out.print(" "+A[j]);
				System.out.println();
			}
		}
	} final int Number=100; Number 100 try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			int[] A = new int[N];
			for(int i=0;i<N;i++)A[i]=Integer.parseInt(sc.next());
			System.out.print(A[0]);
			for(int j=1;j<N;j++)System.out.print(" "+A[j]);
			System.out.println();
			for(int i=1;i<N;i++){
				int v = A[i];
				for(int j = i-1;(j>=0)&&(A[j]>v);j--){
					A[j+1]=A[j];
					A[j]=v;
				}
				
				System.out.print(A[0]);
				for(int j=1;j<N;j++)System.out.print(" "+A[j]);
				System.out.println();
			}
		} {
			int N = Integer.parseInt(sc.next());
			int[] A = new int[N];
			for(int i=0;i<N;i++)A[i]=Integer.parseInt(sc.next());
			System.out.print(A[0]);
			for(int j=1;j<N;j++)System.out.print(" "+A[j]);
			System.out.println();
			for(int i=1;i<N;i++){
				int v = A[i];
				for(int j = i-1;(j>=0)&&(A[j]>v);j--){
					A[j+1]=A[j];
					A[j]=v;
				}
				
				System.out.print(A[0]);
				for(int j=1;j<N;j++)System.out.print(" "+A[j]);
				System.out.println();
			}
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] A = new int[N]; A new int[N] N for(int i=0;i<N;i++)A[i]=Integer.parseInt(sc.next()); int i=0; int i=0; i 0 i<N i N i++ i++ i 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 System.out.print(A[0]) System.out.print System.out System System.out A[0] A 0 for(int j=1;j<N;j++)System.out.print(" "+A[j]); int j=1; int j=1; j 1 j<N j N j++ j++ j System.out.print(" "+A[j]); System.out.print(" "+A[j]) System.out.print System.out System System.out " "+A[j] " " A[j] A j System.out.println() System.out.println System.out System System.out for(int i=1;i<N;i++){
				int v = A[i];
				for(int j = i-1;(j>=0)&&(A[j]>v);j--){
					A[j+1]=A[j];
					A[j]=v;
				}
				
				System.out.print(A[0]);
				for(int j=1;j<N;j++)System.out.print(" "+A[j]);
				System.out.println();
			} int i=1; int i=1; i 1 i<N i N i++ i++ i {
				int v = A[i];
				for(int j = i-1;(j>=0)&&(A[j]>v);j--){
					A[j+1]=A[j];
					A[j]=v;
				}
				
				System.out.print(A[0]);
				for(int j=1;j<N;j++)System.out.print(" "+A[j]);
				System.out.println();
			} {
				int v = A[i];
				for(int j = i-1;(j>=0)&&(A[j]>v);j--){
					A[j+1]=A[j];
					A[j]=v;
				}
				
				System.out.print(A[0]);
				for(int j=1;j<N;j++)System.out.print(" "+A[j]);
				System.out.println();
			} int v = A[i]; v A[i] A i for(int j = i-1;(j>=0)&&(A[j]>v);j--){
					A[j+1]=A[j];
					A[j]=v;
				} int j = i-1; int j = i-1; j i-1 i 1 (j>=0)&&(A[j]>v) (j>=0) j 0 (A[j]>v) A[j] A j v j-- j-- j {
					A[j+1]=A[j];
					A[j]=v;
				} {
					A[j+1]=A[j];
					A[j]=v;
				} A[j+1]=A[j] A[j+1] A j+1 j 1 A[j] A j A[j]=v A[j] A j v System.out.print(A[0]) System.out.print System.out System System.out A[0] A 0 for(int j=1;j<N;j++)System.out.print(" "+A[j]); int j=1; int j=1; j 1 j<N j N j++ j++ j System.out.print(" "+A[j]); System.out.print(" "+A[j]) System.out.print System.out System System.out " "+A[j] " " A[j] A j System.out.println() System.out.println System.out System System.out String[] args args
import java.util.Scanner;
class Main {
	public static void main(String[] args){
		final int Number=100;
		try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			int[] A = new int[N];
			for(int i=0;i<N;i++)A[i]=Integer.parseInt(sc.next());
			System.out.print(A[0]);
			for(int j=1;j<N;j++)System.out.print(" "+A[j]);
			System.out.println();
			for(int i=1;i<N;i++){
				int v = A[i];
				for(int j = i-1;(j>=0)&&(A[j]>v);j--){
					A[j+1]=A[j];
					A[j]=v;
				}
				
				System.out.print(A[0]);
				for(int j=1;j<N;j++)System.out.print(" "+A[j]);
				System.out.println();
			}
		}
	}
}