import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
	
		// First input needs to be length
		int length = in.nextInt();
	
		// Create an array with that length
		int[] a = new int[length];
		
		// Fill in that array with the second input
		for (int i = 0; i < length; i++) {
			a[i] = in.nextInt();
		}
		
		// Prints the unsorted Array
		print(a);
		System.out.println();
		
		//Now time to sort it
		for (int i = 1; i < length; i++) {
			// the value of this specific index
			int ind = a[i];
			// index for the number before the index (i) now
			int j = i -1;
			// WHILE j is positive and it's value is greater than ind...
			while(j>=0 && a[j] > ind) {
				// The value will be pushed down away from ind
				a[j+1] = a[j];
				j = j-1;
			}
			// if they find a value less, than the ind is pushed so that value is before it
			a[j+1] = ind;
			//Show the array as it's sorted
			print(a);
			System.out.println();
		}
	
	
	}
	
	public static void print(int[] nums) {
		
		
		for (int i = 0; i < nums.length-1; i++) {
			System.out.print(nums[i]);
			System.out.print(" ");
		}
		System.out.print(nums[nums.length-1]);	
	}
	
}
 import java.util.Scanner; Scanner java.util public class Main {
	
	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
	
		// First input needs to be length
		int length = in.nextInt();
	
		// Create an array with that length
		int[] a = new int[length];
		
		// Fill in that array with the second input
		for (int i = 0; i < length; i++) {
			a[i] = in.nextInt();
		}
		
		// Prints the unsorted Array
		print(a);
		System.out.println();
		
		//Now time to sort it
		for (int i = 1; i < length; i++) {
			// the value of this specific index
			int ind = a[i];
			// index for the number before the index (i) now
			int j = i -1;
			// WHILE j is positive and it's value is greater than ind...
			while(j>=0 && a[j] > ind) {
				// The value will be pushed down away from ind
				a[j+1] = a[j];
				j = j-1;
			}
			// if they find a value less, than the ind is pushed so that value is before it
			a[j+1] = ind;
			//Show the array as it's sorted
			print(a);
			System.out.println();
		}
	
	
	}
	
	public static void print(int[] nums) {
		
		
		for (int i = 0; i < nums.length-1; i++) {
			System.out.print(nums[i]);
			System.out.print(" ");
		}
		System.out.print(nums[nums.length-1]);	
	}
	
} Main public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
	
		// First input needs to be length
		int length = in.nextInt();
	
		// Create an array with that length
		int[] a = new int[length];
		
		// Fill in that array with the second input
		for (int i = 0; i < length; i++) {
			a[i] = in.nextInt();
		}
		
		// Prints the unsorted Array
		print(a);
		System.out.println();
		
		//Now time to sort it
		for (int i = 1; i < length; i++) {
			// the value of this specific index
			int ind = a[i];
			// index for the number before the index (i) now
			int j = i -1;
			// WHILE j is positive and it's value is greater than ind...
			while(j>=0 && a[j] > ind) {
				// The value will be pushed down away from ind
				a[j+1] = a[j];
				j = j-1;
			}
			// if they find a value less, than the ind is pushed so that value is before it
			a[j+1] = ind;
			//Show the array as it's sorted
			print(a);
			System.out.println();
		}
	
	
	} main {

		Scanner in = new Scanner(System.in);
	
		// First input needs to be length
		int length = in.nextInt();
	
		// Create an array with that length
		int[] a = new int[length];
		
		// Fill in that array with the second input
		for (int i = 0; i < length; i++) {
			a[i] = in.nextInt();
		}
		
		// Prints the unsorted Array
		print(a);
		System.out.println();
		
		//Now time to sort it
		for (int i = 1; i < length; i++) {
			// the value of this specific index
			int ind = a[i];
			// index for the number before the index (i) now
			int j = i -1;
			// WHILE j is positive and it's value is greater than ind...
			while(j>=0 && a[j] > ind) {
				// The value will be pushed down away from ind
				a[j+1] = a[j];
				j = j-1;
			}
			// if they find a value less, than the ind is pushed so that value is before it
			a[j+1] = ind;
			//Show the array as it's sorted
			print(a);
			System.out.println();
		}
	
	
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int length = in.nextInt(); length in.nextInt() in.nextInt in int[] a = new int[length]; a new int[length] length for (int i = 0; i < length; i++) {
			a[i] = in.nextInt();
		} int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
			a[i] = in.nextInt();
		} {
			a[i] = in.nextInt();
		} a[i] = in.nextInt() a[i] a i in.nextInt() in.nextInt in print(a) print a System.out.println() System.out.println System.out System System.out for (int i = 1; i < length; i++) {
			// the value of this specific index
			int ind = a[i];
			// index for the number before the index (i) now
			int j = i -1;
			// WHILE j is positive and it's value is greater than ind...
			while(j>=0 && a[j] > ind) {
				// The value will be pushed down away from ind
				a[j+1] = a[j];
				j = j-1;
			}
			// if they find a value less, than the ind is pushed so that value is before it
			a[j+1] = ind;
			//Show the array as it's sorted
			print(a);
			System.out.println();
		} int i = 1; int i = 1; i 1 i < length i length i++ i++ i {
			// the value of this specific index
			int ind = a[i];
			// index for the number before the index (i) now
			int j = i -1;
			// WHILE j is positive and it's value is greater than ind...
			while(j>=0 && a[j] > ind) {
				// The value will be pushed down away from ind
				a[j+1] = a[j];
				j = j-1;
			}
			// if they find a value less, than the ind is pushed so that value is before it
			a[j+1] = ind;
			//Show the array as it's sorted
			print(a);
			System.out.println();
		} {
			// the value of this specific index
			int ind = a[i];
			// index for the number before the index (i) now
			int j = i -1;
			// WHILE j is positive and it's value is greater than ind...
			while(j>=0 && a[j] > ind) {
				// The value will be pushed down away from ind
				a[j+1] = a[j];
				j = j-1;
			}
			// if they find a value less, than the ind is pushed so that value is before it
			a[j+1] = ind;
			//Show the array as it's sorted
			print(a);
			System.out.println();
		} int ind = a[i]; ind a[i] a i int j = i -1; j i -1 i 1 while(j>=0 && a[j] > ind) {
				// The value will be pushed down away from ind
				a[j+1] = a[j];
				j = j-1;
			} j>=0 && a[j] > ind j>=0 j 0 a[j] > ind a[j] a j ind {
				// The value will be pushed down away from ind
				a[j+1] = a[j];
				j = j-1;
			} a[j+1] = a[j] a[j+1] a j+1 j 1 a[j] a j j = j-1 j j-1 j 1 a[j+1] = ind a[j+1] a j+1 j 1 ind print(a) print a System.out.println() System.out.println System.out System System.out String[] args args public static void print(int[] nums) {
		
		
		for (int i = 0; i < nums.length-1; i++) {
			System.out.print(nums[i]);
			System.out.print(" ");
		}
		System.out.print(nums[nums.length-1]);	
	} print {
		
		
		for (int i = 0; i < nums.length-1; i++) {
			System.out.print(nums[i]);
			System.out.print(" ");
		}
		System.out.print(nums[nums.length-1]);	
	} for (int i = 0; i < nums.length-1; i++) {
			System.out.print(nums[i]);
			System.out.print(" ");
		} int i = 0; int i = 0; i 0 i < nums.length-1 i nums.length-1 nums.length nums nums.length 1 i++ i++ i {
			System.out.print(nums[i]);
			System.out.print(" ");
		} {
			System.out.print(nums[i]);
			System.out.print(" ");
		} System.out.print(nums[i]) System.out.print System.out System System.out nums[i] nums i System.out.print(" ") System.out.print System.out System System.out " " System.out.print(nums[nums.length-1]) System.out.print System.out System System.out nums[nums.length-1] nums nums.length-1 nums.length nums nums.length 1 int[] nums nums public class Main {
	
	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
	
		// First input needs to be length
		int length = in.nextInt();
	
		// Create an array with that length
		int[] a = new int[length];
		
		// Fill in that array with the second input
		for (int i = 0; i < length; i++) {
			a[i] = in.nextInt();
		}
		
		// Prints the unsorted Array
		print(a);
		System.out.println();
		
		//Now time to sort it
		for (int i = 1; i < length; i++) {
			// the value of this specific index
			int ind = a[i];
			// index for the number before the index (i) now
			int j = i -1;
			// WHILE j is positive and it's value is greater than ind...
			while(j>=0 && a[j] > ind) {
				// The value will be pushed down away from ind
				a[j+1] = a[j];
				j = j-1;
			}
			// if they find a value less, than the ind is pushed so that value is before it
			a[j+1] = ind;
			//Show the array as it's sorted
			print(a);
			System.out.println();
		}
	
	
	}
	
	public static void print(int[] nums) {
		
		
		for (int i = 0; i < nums.length-1; i++) {
			System.out.print(nums[i]);
			System.out.print(" ");
		}
		System.out.print(nums[nums.length-1]);	
	}
	
} public class Main {
	
	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
	
		// First input needs to be length
		int length = in.nextInt();
	
		// Create an array with that length
		int[] a = new int[length];
		
		// Fill in that array with the second input
		for (int i = 0; i < length; i++) {
			a[i] = in.nextInt();
		}
		
		// Prints the unsorted Array
		print(a);
		System.out.println();
		
		//Now time to sort it
		for (int i = 1; i < length; i++) {
			// the value of this specific index
			int ind = a[i];
			// index for the number before the index (i) now
			int j = i -1;
			// WHILE j is positive and it's value is greater than ind...
			while(j>=0 && a[j] > ind) {
				// The value will be pushed down away from ind
				a[j+1] = a[j];
				j = j-1;
			}
			// if they find a value less, than the ind is pushed so that value is before it
			a[j+1] = ind;
			//Show the array as it's sorted
			print(a);
			System.out.println();
		}
	
	
	}
	
	public static void print(int[] nums) {
		
		
		for (int i = 0; i < nums.length-1; i++) {
			System.out.print(nums[i]);
			System.out.print(" ");
		}
		System.out.print(nums[nums.length-1]);	
	}
	
} Main
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
	
		// First input needs to be length
		int length = in.nextInt();
	
		// Create an array with that length
		int[] a = new int[length];
		
		// Fill in that array with the second input
		for (int i = 0; i < length; i++) {
			a[i] = in.nextInt();
		}
		
		// Prints the unsorted Array
		print(a);
		System.out.println();
		
		//Now time to sort it
		for (int i = 1; i < length; i++) {
			// the value of this specific index
			int ind = a[i];
			// index for the number before the index (i) now
			int j = i -1;
			// WHILE j is positive and it's value is greater than ind...
			while(j>=0 && a[j] > ind) {
				// The value will be pushed down away from ind
				a[j+1] = a[j];
				j = j-1;
			}
			// if they find a value less, than the ind is pushed so that value is before it
			a[j+1] = ind;
			//Show the array as it's sorted
			print(a);
			System.out.println();
		}
	
	
	}
	
	public static void print(int[] nums) {
		
		
		for (int i = 0; i < nums.length-1; i++) {
			System.out.print(nums[i]);
			System.out.print(" ");
		}
		System.out.print(nums[nums.length-1]);	
	}
	
}

