import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] sorted = new int[n];
		for(int i = 0; i < n; i++) {
			sorted[i] = in.nextInt();
		}
		for(int i = 0; i < n; i++) {
			int temp = sorted[i];
			int j = i-1;
			while(j >= 0 && temp < sorted[j]) {
				sorted[j+1] = sorted[j];
				j--;
			}
			sorted[j+1] = temp;
			for(int a = 0; a < sorted.length; a++) {
				if(a == sorted.length - 1) System.out.print(sorted[a]);
				else System.out.print(sorted[a] + " ");
			}
			System.out.println();
		}
	}

}
 import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] sorted = new int[n];
		for(int i = 0; i < n; i++) {
			sorted[i] = in.nextInt();
		}
		for(int i = 0; i < n; i++) {
			int temp = sorted[i];
			int j = i-1;
			while(j >= 0 && temp < sorted[j]) {
				sorted[j+1] = sorted[j];
				j--;
			}
			sorted[j+1] = temp;
			for(int a = 0; a < sorted.length; a++) {
				if(a == sorted.length - 1) System.out.print(sorted[a]);
				else System.out.print(sorted[a] + " ");
			}
			System.out.println();
		}
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] sorted = new int[n];
		for(int i = 0; i < n; i++) {
			sorted[i] = in.nextInt();
		}
		for(int i = 0; i < n; i++) {
			int temp = sorted[i];
			int j = i-1;
			while(j >= 0 && temp < sorted[j]) {
				sorted[j+1] = sorted[j];
				j--;
			}
			sorted[j+1] = temp;
			for(int a = 0; a < sorted.length; a++) {
				if(a == sorted.length - 1) System.out.print(sorted[a]);
				else System.out.print(sorted[a] + " ");
			}
			System.out.println();
		}
	} main {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] sorted = new int[n];
		for(int i = 0; i < n; i++) {
			sorted[i] = in.nextInt();
		}
		for(int i = 0; i < n; i++) {
			int temp = sorted[i];
			int j = i-1;
			while(j >= 0 && temp < sorted[j]) {
				sorted[j+1] = sorted[j];
				j--;
			}
			sorted[j+1] = temp;
			for(int a = 0; a < sorted.length; a++) {
				if(a == sorted.length - 1) System.out.print(sorted[a]);
				else System.out.print(sorted[a] + " ");
			}
			System.out.println();
		}
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int[] sorted = new int[n]; sorted new int[n] n for(int i = 0; i < n; i++) {
			sorted[i] = in.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			sorted[i] = in.nextInt();
		} {
			sorted[i] = in.nextInt();
		} sorted[i] = in.nextInt() sorted[i] sorted i in.nextInt() in.nextInt in for(int i = 0; i < n; i++) {
			int temp = sorted[i];
			int j = i-1;
			while(j >= 0 && temp < sorted[j]) {
				sorted[j+1] = sorted[j];
				j--;
			}
			sorted[j+1] = temp;
			for(int a = 0; a < sorted.length; a++) {
				if(a == sorted.length - 1) System.out.print(sorted[a]);
				else System.out.print(sorted[a] + " ");
			}
			System.out.println();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int temp = sorted[i];
			int j = i-1;
			while(j >= 0 && temp < sorted[j]) {
				sorted[j+1] = sorted[j];
				j--;
			}
			sorted[j+1] = temp;
			for(int a = 0; a < sorted.length; a++) {
				if(a == sorted.length - 1) System.out.print(sorted[a]);
				else System.out.print(sorted[a] + " ");
			}
			System.out.println();
		} {
			int temp = sorted[i];
			int j = i-1;
			while(j >= 0 && temp < sorted[j]) {
				sorted[j+1] = sorted[j];
				j--;
			}
			sorted[j+1] = temp;
			for(int a = 0; a < sorted.length; a++) {
				if(a == sorted.length - 1) System.out.print(sorted[a]);
				else System.out.print(sorted[a] + " ");
			}
			System.out.println();
		} int temp = sorted[i]; temp sorted[i] sorted i int j = i-1; j i-1 i 1 while(j >= 0 && temp < sorted[j]) {
				sorted[j+1] = sorted[j];
				j--;
			} j >= 0 && temp < sorted[j] j >= 0 j 0 temp < sorted[j] temp sorted[j] sorted j {
				sorted[j+1] = sorted[j];
				j--;
			} sorted[j+1] = sorted[j] sorted[j+1] sorted j+1 j 1 sorted[j] sorted j j-- j sorted[j+1] = temp sorted[j+1] sorted j+1 j 1 temp for(int a = 0; a < sorted.length; a++) {
				if(a == sorted.length - 1) System.out.print(sorted[a]);
				else System.out.print(sorted[a] + " ");
			} int a = 0; int a = 0; a 0 a < sorted.length a sorted.length sorted sorted.length a++ a++ a {
				if(a == sorted.length - 1) System.out.print(sorted[a]);
				else System.out.print(sorted[a] + " ");
			} {
				if(a == sorted.length - 1) System.out.print(sorted[a]);
				else System.out.print(sorted[a] + " ");
			} if(a == sorted.length - 1) System.out.print(sorted[a]);
				else System.out.print(sorted[a] + " "); a == sorted.length - 1 a sorted.length - 1 sorted.length sorted sorted.length 1 System.out.print(sorted[a]) System.out.print System.out System System.out sorted[a] sorted a System.out.print(sorted[a] + " ") System.out.print System.out System System.out sorted[a] + " " sorted[a] sorted a " " System.out.println() System.out.println System.out System System.out String[] args args public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] sorted = new int[n];
		for(int i = 0; i < n; i++) {
			sorted[i] = in.nextInt();
		}
		for(int i = 0; i < n; i++) {
			int temp = sorted[i];
			int j = i-1;
			while(j >= 0 && temp < sorted[j]) {
				sorted[j+1] = sorted[j];
				j--;
			}
			sorted[j+1] = temp;
			for(int a = 0; a < sorted.length; a++) {
				if(a == sorted.length - 1) System.out.print(sorted[a]);
				else System.out.print(sorted[a] + " ");
			}
			System.out.println();
		}
	}

} public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] sorted = new int[n];
		for(int i = 0; i < n; i++) {
			sorted[i] = in.nextInt();
		}
		for(int i = 0; i < n; i++) {
			int temp = sorted[i];
			int j = i-1;
			while(j >= 0 && temp < sorted[j]) {
				sorted[j+1] = sorted[j];
				j--;
			}
			sorted[j+1] = temp;
			for(int a = 0; a < sorted.length; a++) {
				if(a == sorted.length - 1) System.out.print(sorted[a]);
				else System.out.print(sorted[a] + " ");
			}
			System.out.println();
		}
	}

} Main
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] sorted = new int[n];
		for(int i = 0; i < n; i++) {
			sorted[i] = in.nextInt();
		}
		for(int i = 0; i < n; i++) {
			int temp = sorted[i];
			int j = i-1;
			while(j >= 0 && temp < sorted[j]) {
				sorted[j+1] = sorted[j];
				j--;
			}
			sorted[j+1] = temp;
			for(int a = 0; a < sorted.length; a++) {
				if(a == sorted.length - 1) System.out.print(sorted[a]);
				else System.out.print(sorted[a] + " ");
			}
			System.out.println();
		}
	}

}

