import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int len = scanner.nextInt();
		int nums[] = new int[len] ;
		for (int i = 0; i < len; i++) {
			nums[i] = scanner.nextInt();
		}
		
		for (int i = 1; i < nums.length; i++) {
			new Main().arrayToString(nums);
			int val = nums[i];
			int preIndex = i-1;
			while (preIndex>=0 && nums[preIndex] > val) {
				nums[preIndex+1] = nums[preIndex];
				nums[preIndex] = val;
				preIndex--;
			}
		}
		new Main().arrayToString(nums);
	}
	
	public void arrayToString(int[] arr) {
		for (int i = 0; i < arr.length; i++) {
			
			if (i == arr.length-1) {
				System.out.println(arr[i]);
			}else {
				System.out.print(arr[i]+" ");
			}
		}
	}

} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int len = scanner.nextInt();
		int nums[] = new int[len] ;
		for (int i = 0; i < len; i++) {
			nums[i] = scanner.nextInt();
		}
		
		for (int i = 1; i < nums.length; i++) {
			new Main().arrayToString(nums);
			int val = nums[i];
			int preIndex = i-1;
			while (preIndex>=0 && nums[preIndex] > val) {
				nums[preIndex+1] = nums[preIndex];
				nums[preIndex] = val;
				preIndex--;
			}
		}
		new Main().arrayToString(nums);
	}
	
	public void arrayToString(int[] arr) {
		for (int i = 0; i < arr.length; i++) {
			
			if (i == arr.length-1) {
				System.out.println(arr[i]);
			}else {
				System.out.print(arr[i]+" ");
			}
		}
	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int len = scanner.nextInt();
		int nums[] = new int[len] ;
		for (int i = 0; i < len; i++) {
			nums[i] = scanner.nextInt();
		}
		
		for (int i = 1; i < nums.length; i++) {
			new Main().arrayToString(nums);
			int val = nums[i];
			int preIndex = i-1;
			while (preIndex>=0 && nums[preIndex] > val) {
				nums[preIndex+1] = nums[preIndex];
				nums[preIndex] = val;
				preIndex--;
			}
		}
		new Main().arrayToString(nums);
	} main {
		Scanner scanner = new Scanner(System.in);
		int len = scanner.nextInt();
		int nums[] = new int[len] ;
		for (int i = 0; i < len; i++) {
			nums[i] = scanner.nextInt();
		}
		
		for (int i = 1; i < nums.length; i++) {
			new Main().arrayToString(nums);
			int val = nums[i];
			int preIndex = i-1;
			while (preIndex>=0 && nums[preIndex] > val) {
				nums[preIndex+1] = nums[preIndex];
				nums[preIndex] = val;
				preIndex--;
			}
		}
		new Main().arrayToString(nums);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int len = scanner.nextInt(); len scanner.nextInt() scanner.nextInt scanner int nums[] = new int[len] ; nums new int[len] len for (int i = 0; i < len; i++) {
			nums[i] = scanner.nextInt();
		} int i = 0; int i = 0; i 0 i < len i len i++ i++ i {
			nums[i] = scanner.nextInt();
		} {
			nums[i] = scanner.nextInt();
		} nums[i] = scanner.nextInt() nums[i] nums i scanner.nextInt() scanner.nextInt scanner for (int i = 1; i < nums.length; i++) {
			new Main().arrayToString(nums);
			int val = nums[i];
			int preIndex = i-1;
			while (preIndex>=0 && nums[preIndex] > val) {
				nums[preIndex+1] = nums[preIndex];
				nums[preIndex] = val;
				preIndex--;
			}
		} int i = 1; int i = 1; i 1 i < nums.length i nums.length nums nums.length i++ i++ i {
			new Main().arrayToString(nums);
			int val = nums[i];
			int preIndex = i-1;
			while (preIndex>=0 && nums[preIndex] > val) {
				nums[preIndex+1] = nums[preIndex];
				nums[preIndex] = val;
				preIndex--;
			}
		} {
			new Main().arrayToString(nums);
			int val = nums[i];
			int preIndex = i-1;
			while (preIndex>=0 && nums[preIndex] > val) {
				nums[preIndex+1] = nums[preIndex];
				nums[preIndex] = val;
				preIndex--;
			}
		} new Main().arrayToString(nums) new Main().arrayToString new Main() nums int val = nums[i]; val nums[i] nums i int preIndex = i-1; preIndex i-1 i 1 while (preIndex>=0 && nums[preIndex] > val) {
				nums[preIndex+1] = nums[preIndex];
				nums[preIndex] = val;
				preIndex--;
			} preIndex>=0 && nums[preIndex] > val preIndex>=0 preIndex 0 nums[preIndex] > val nums[preIndex] nums preIndex val {
				nums[preIndex+1] = nums[preIndex];
				nums[preIndex] = val;
				preIndex--;
			} nums[preIndex+1] = nums[preIndex] nums[preIndex+1] nums preIndex+1 preIndex 1 nums[preIndex] nums preIndex nums[preIndex] = val nums[preIndex] nums preIndex val preIndex-- preIndex new Main().arrayToString(nums) new Main().arrayToString new Main() nums String[] args args public void arrayToString(int[] arr) {
		for (int i = 0; i < arr.length; i++) {
			
			if (i == arr.length-1) {
				System.out.println(arr[i]);
			}else {
				System.out.print(arr[i]+" ");
			}
		}
	} arrayToString {
		for (int i = 0; i < arr.length; i++) {
			
			if (i == arr.length-1) {
				System.out.println(arr[i]);
			}else {
				System.out.print(arr[i]+" ");
			}
		}
	} for (int i = 0; i < arr.length; i++) {
			
			if (i == arr.length-1) {
				System.out.println(arr[i]);
			}else {
				System.out.print(arr[i]+" ");
			}
		} int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
			
			if (i == arr.length-1) {
				System.out.println(arr[i]);
			}else {
				System.out.print(arr[i]+" ");
			}
		} {
			
			if (i == arr.length-1) {
				System.out.println(arr[i]);
			}else {
				System.out.print(arr[i]+" ");
			}
		} if (i == arr.length-1) {
				System.out.println(arr[i]);
			}else {
				System.out.print(arr[i]+" ");
			} i == arr.length-1 i arr.length-1 arr.length arr arr.length 1 {
				System.out.println(arr[i]);
			} System.out.println(arr[i]) System.out.println System.out System System.out arr[i] arr i {
				System.out.print(arr[i]+" ");
			} System.out.print(arr[i]+" ") System.out.print System.out System System.out arr[i]+" " arr[i] arr i " " int[] arr arr public class Main{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int len = scanner.nextInt();
		int nums[] = new int[len] ;
		for (int i = 0; i < len; i++) {
			nums[i] = scanner.nextInt();
		}
		
		for (int i = 1; i < nums.length; i++) {
			new Main().arrayToString(nums);
			int val = nums[i];
			int preIndex = i-1;
			while (preIndex>=0 && nums[preIndex] > val) {
				nums[preIndex+1] = nums[preIndex];
				nums[preIndex] = val;
				preIndex--;
			}
		}
		new Main().arrayToString(nums);
	}
	
	public void arrayToString(int[] arr) {
		for (int i = 0; i < arr.length; i++) {
			
			if (i == arr.length-1) {
				System.out.println(arr[i]);
			}else {
				System.out.print(arr[i]+" ");
			}
		}
	}

} public class Main{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int len = scanner.nextInt();
		int nums[] = new int[len] ;
		for (int i = 0; i < len; i++) {
			nums[i] = scanner.nextInt();
		}
		
		for (int i = 1; i < nums.length; i++) {
			new Main().arrayToString(nums);
			int val = nums[i];
			int preIndex = i-1;
			while (preIndex>=0 && nums[preIndex] > val) {
				nums[preIndex+1] = nums[preIndex];
				nums[preIndex] = val;
				preIndex--;
			}
		}
		new Main().arrayToString(nums);
	}
	
	public void arrayToString(int[] arr) {
		for (int i = 0; i < arr.length; i++) {
			
			if (i == arr.length-1) {
				System.out.println(arr[i]);
			}else {
				System.out.print(arr[i]+" ");
			}
		}
	}

} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int len = scanner.nextInt();
		int nums[] = new int[len] ;
		for (int i = 0; i < len; i++) {
			nums[i] = scanner.nextInt();
		}
		
		for (int i = 1; i < nums.length; i++) {
			new Main().arrayToString(nums);
			int val = nums[i];
			int preIndex = i-1;
			while (preIndex>=0 && nums[preIndex] > val) {
				nums[preIndex+1] = nums[preIndex];
				nums[preIndex] = val;
				preIndex--;
			}
		}
		new Main().arrayToString(nums);
	}
	
	public void arrayToString(int[] arr) {
		for (int i = 0; i < arr.length; i++) {
			
			if (i == arr.length-1) {
				System.out.println(arr[i]);
			}else {
				System.out.print(arr[i]+" ");
			}
		}
	}

}
