import java.io.*;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;
public class Main {
	static String a;
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[] a = new int[n];
		for(int i = 0; i < n; i++) {
			a[i] = stdIn.nextInt();
		}
		show(a,n);
		insertionSort(a,n);
		
	}
	static void show(int[] a, int n) {
		System.out.print(a[0]);
		for(int i = 1; i < n; i++) {
			System.out.print(" " + a[i]);
		}
		System.out.println();
	}
	static void insertionSort(int[] a, int n) {
		for(int i = 1; i < n; i++) {
			int v = a[i];
			int j = i-1;
			while(j >= 0 && a[j] > v) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = v;
			show(a,n);
		}
	}
} import java.io.*; io.* java import java.util.ArrayDeque; ArrayDeque java.util import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Comparator; Comparator java.util import java.util.Scanner; Scanner java.util public class Main {
	static String a;
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[] a = new int[n];
		for(int i = 0; i < n; i++) {
			a[i] = stdIn.nextInt();
		}
		show(a,n);
		insertionSort(a,n);
		
	}
	static void show(int[] a, int n) {
		System.out.print(a[0]);
		for(int i = 1; i < n; i++) {
			System.out.print(" " + a[i]);
		}
		System.out.println();
	}
	static void insertionSort(int[] a, int n) {
		for(int i = 1; i < n; i++) {
			int v = a[i];
			int j = i-1;
			while(j >= 0 && a[j] > v) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = v;
			show(a,n);
		}
	}
} Main static String a; a public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[] a = new int[n];
		for(int i = 0; i < n; i++) {
			a[i] = stdIn.nextInt();
		}
		show(a,n);
		insertionSort(a,n);
		
	} main {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[] a = new int[n];
		for(int i = 0; i < n; i++) {
			a[i] = stdIn.nextInt();
		}
		show(a,n);
		insertionSort(a,n);
		
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int[] a = new int[n]; a new int[n] n for(int i = 0; i < n; i++) {
			a[i] = stdIn.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = stdIn.nextInt();
		} {
			a[i] = stdIn.nextInt();
		} a[i] = stdIn.nextInt() a[i] a i stdIn.nextInt() stdIn.nextInt stdIn show(a,n) show a n insertionSort(a,n) insertionSort a n String[] args args static void show(int[] a, int n) {
		System.out.print(a[0]);
		for(int i = 1; i < n; i++) {
			System.out.print(" " + a[i]);
		}
		System.out.println();
	} show {
		System.out.print(a[0]);
		for(int i = 1; i < n; i++) {
			System.out.print(" " + a[i]);
		}
		System.out.println();
	} System.out.print(a[0]) System.out.print System.out System System.out a[0] a 0 for(int i = 1; i < n; i++) {
			System.out.print(" " + a[i]);
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			System.out.print(" " + a[i]);
		} {
			System.out.print(" " + a[i]);
		} System.out.print(" " + a[i]) System.out.print System.out System System.out " " + a[i] " " a[i] a i System.out.println() System.out.println System.out System System.out int[] a a int n n static void insertionSort(int[] a, int n) {
		for(int i = 1; i < n; i++) {
			int v = a[i];
			int j = i-1;
			while(j >= 0 && a[j] > v) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = v;
			show(a,n);
		}
	} insertionSort {
		for(int i = 1; i < n; i++) {
			int v = a[i];
			int j = i-1;
			while(j >= 0 && a[j] > v) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = v;
			show(a,n);
		}
	} for(int i = 1; i < n; i++) {
			int v = a[i];
			int j = i-1;
			while(j >= 0 && a[j] > v) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = v;
			show(a,n);
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			int v = a[i];
			int j = i-1;
			while(j >= 0 && a[j] > v) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = v;
			show(a,n);
		} {
			int v = a[i];
			int j = i-1;
			while(j >= 0 && a[j] > v) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = v;
			show(a,n);
		} int v = a[i]; v a[i] a i int 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 show(a,n) show a n int[] a a int n n public class Main {
	static String a;
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[] a = new int[n];
		for(int i = 0; i < n; i++) {
			a[i] = stdIn.nextInt();
		}
		show(a,n);
		insertionSort(a,n);
		
	}
	static void show(int[] a, int n) {
		System.out.print(a[0]);
		for(int i = 1; i < n; i++) {
			System.out.print(" " + a[i]);
		}
		System.out.println();
	}
	static void insertionSort(int[] a, int n) {
		for(int i = 1; i < n; i++) {
			int v = a[i];
			int j = i-1;
			while(j >= 0 && a[j] > v) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = v;
			show(a,n);
		}
	}
} public class Main {
	static String a;
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[] a = new int[n];
		for(int i = 0; i < n; i++) {
			a[i] = stdIn.nextInt();
		}
		show(a,n);
		insertionSort(a,n);
		
	}
	static void show(int[] a, int n) {
		System.out.print(a[0]);
		for(int i = 1; i < n; i++) {
			System.out.print(" " + a[i]);
		}
		System.out.println();
	}
	static void insertionSort(int[] a, int n) {
		for(int i = 1; i < n; i++) {
			int v = a[i];
			int j = i-1;
			while(j >= 0 && a[j] > v) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = v;
			show(a,n);
		}
	}
} Main
import java.io.*;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;
public class Main {
	static String a;
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[] a = new int[n];
		for(int i = 0; i < n; i++) {
			a[i] = stdIn.nextInt();
		}
		show(a,n);
		insertionSort(a,n);
		
	}
	static void show(int[] a, int n) {
		System.out.print(a[0]);
		for(int i = 1; i < n; i++) {
			System.out.print(" " + a[i]);
		}
		System.out.println();
	}
	static void insertionSort(int[] a, int n) {
		for(int i = 1; i < n; i++) {
			int v = a[i];
			int j = i-1;
			while(j >= 0 && a[j] > v) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = v;
			show(a,n);
		}
	}
}