import java.util.Scanner;

public class Main{
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int length = Integer.parseInt(scan.nextLine());
		String[] numStrings = scan.nextLine().split(" ");
		int[] nums = new int[length];
		for(int i = 0; i < length; i++)
			nums[i] = Integer.parseInt(numStrings[i]);
		
		for(int n = 0; n < length; n++) {
			System.out.print(nums[n]);
			if(n < length - 1)
				System.out.print(" ");
		}
		System.out.println();
		
		for(int i = 1; i < nums.length; i++) {
			int current = nums[i];
			
			int index = 0;
			while(current > nums[index] && index < i)
				index++;
			
			for(int n = i; n > index; n--)
				nums[n] = nums[n - 1];
			
			nums[index] = current;
		
			for(int n = 0; n < length; n++) {
				System.out.print(nums[n]);
				if(n < length - 1)
					System.out.print(" ");
			}
			System.out.println();
		}
	}
}
 import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int length = Integer.parseInt(scan.nextLine());
		String[] numStrings = scan.nextLine().split(" ");
		int[] nums = new int[length];
		for(int i = 0; i < length; i++)
			nums[i] = Integer.parseInt(numStrings[i]);
		
		for(int n = 0; n < length; n++) {
			System.out.print(nums[n]);
			if(n < length - 1)
				System.out.print(" ");
		}
		System.out.println();
		
		for(int i = 1; i < nums.length; i++) {
			int current = nums[i];
			
			int index = 0;
			while(current > nums[index] && index < i)
				index++;
			
			for(int n = i; n > index; n--)
				nums[n] = nums[n - 1];
			
			nums[index] = current;
		
			for(int n = 0; n < length; n++) {
				System.out.print(nums[n]);
				if(n < length - 1)
					System.out.print(" ");
			}
			System.out.println();
		}
	}
} Main public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int length = Integer.parseInt(scan.nextLine());
		String[] numStrings = scan.nextLine().split(" ");
		int[] nums = new int[length];
		for(int i = 0; i < length; i++)
			nums[i] = Integer.parseInt(numStrings[i]);
		
		for(int n = 0; n < length; n++) {
			System.out.print(nums[n]);
			if(n < length - 1)
				System.out.print(" ");
		}
		System.out.println();
		
		for(int i = 1; i < nums.length; i++) {
			int current = nums[i];
			
			int index = 0;
			while(current > nums[index] && index < i)
				index++;
			
			for(int n = i; n > index; n--)
				nums[n] = nums[n - 1];
			
			nums[index] = current;
		
			for(int n = 0; n < length; n++) {
				System.out.print(nums[n]);
				if(n < length - 1)
					System.out.print(" ");
			}
			System.out.println();
		}
	} main {
		Scanner scan = new Scanner(System.in);
		int length = Integer.parseInt(scan.nextLine());
		String[] numStrings = scan.nextLine().split(" ");
		int[] nums = new int[length];
		for(int i = 0; i < length; i++)
			nums[i] = Integer.parseInt(numStrings[i]);
		
		for(int n = 0; n < length; n++) {
			System.out.print(nums[n]);
			if(n < length - 1)
				System.out.print(" ");
		}
		System.out.println();
		
		for(int i = 1; i < nums.length; i++) {
			int current = nums[i];
			
			int index = 0;
			while(current > nums[index] && index < i)
				index++;
			
			for(int n = i; n > index; n--)
				nums[n] = nums[n - 1];
			
			nums[index] = current;
		
			for(int n = 0; n < length; n++) {
				System.out.print(nums[n]);
				if(n < length - 1)
					System.out.print(" ");
			}
			System.out.println();
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int length = Integer.parseInt(scan.nextLine()); length Integer.parseInt(scan.nextLine()) Integer.parseInt Integer scan.nextLine() scan.nextLine scan String[] numStrings = scan.nextLine().split(" "); numStrings scan.nextLine().split(" ") scan.nextLine().split scan.nextLine() scan.nextLine scan " " int[] nums = new int[length]; nums new int[length] length for(int i = 0; i < length; i++)
			nums[i] = Integer.parseInt(numStrings[i]); int i = 0; int i = 0; i 0 i < length i length i++ i++ i nums[i] = Integer.parseInt(numStrings[i]); nums[i] = Integer.parseInt(numStrings[i]) nums[i] nums i Integer.parseInt(numStrings[i]) Integer.parseInt Integer numStrings[i] numStrings i for(int n = 0; n < length; n++) {
			System.out.print(nums[n]);
			if(n < length - 1)
				System.out.print(" ");
		} int n = 0; int n = 0; n 0 n < length n length n++ n++ n {
			System.out.print(nums[n]);
			if(n < length - 1)
				System.out.print(" ");
		} {
			System.out.print(nums[n]);
			if(n < length - 1)
				System.out.print(" ");
		} System.out.print(nums[n]) System.out.print System.out System System.out nums[n] nums n if(n < length - 1)
				System.out.print(" "); n < length - 1 n length - 1 length 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out for(int i = 1; i < nums.length; i++) {
			int current = nums[i];
			
			int index = 0;
			while(current > nums[index] && index < i)
				index++;
			
			for(int n = i; n > index; n--)
				nums[n] = nums[n - 1];
			
			nums[index] = current;
		
			for(int n = 0; n < length; n++) {
				System.out.print(nums[n]);
				if(n < length - 1)
					System.out.print(" ");
			}
			System.out.println();
		} int i = 1; int i = 1; i 1 i < nums.length i nums.length nums nums.length i++ i++ i {
			int current = nums[i];
			
			int index = 0;
			while(current > nums[index] && index < i)
				index++;
			
			for(int n = i; n > index; n--)
				nums[n] = nums[n - 1];
			
			nums[index] = current;
		
			for(int n = 0; n < length; n++) {
				System.out.print(nums[n]);
				if(n < length - 1)
					System.out.print(" ");
			}
			System.out.println();
		} {
			int current = nums[i];
			
			int index = 0;
			while(current > nums[index] && index < i)
				index++;
			
			for(int n = i; n > index; n--)
				nums[n] = nums[n - 1];
			
			nums[index] = current;
		
			for(int n = 0; n < length; n++) {
				System.out.print(nums[n]);
				if(n < length - 1)
					System.out.print(" ");
			}
			System.out.println();
		} int current = nums[i]; current nums[i] nums i int index = 0; index 0 while(current > nums[index] && index < i)
				index++; current > nums[index] && index < i current > nums[index] current nums[index] nums index index < i index i index++ index for(int n = i; n > index; n--)
				nums[n] = nums[n - 1]; int n = i; int n = i; n i n > index n index n-- n-- n nums[n] = nums[n - 1]; nums[n] = nums[n - 1] nums[n] nums n nums[n - 1] nums n - 1 n 1 nums[index] = current nums[index] nums index current for(int n = 0; n < length; n++) {
				System.out.print(nums[n]);
				if(n < length - 1)
					System.out.print(" ");
			} int n = 0; int n = 0; n 0 n < length n length n++ n++ n {
				System.out.print(nums[n]);
				if(n < length - 1)
					System.out.print(" ");
			} {
				System.out.print(nums[n]);
				if(n < length - 1)
					System.out.print(" ");
			} System.out.print(nums[n]) System.out.print System.out System System.out nums[n] nums n if(n < length - 1)
					System.out.print(" "); n < length - 1 n length - 1 length 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out String [] args args public class Main{
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int length = Integer.parseInt(scan.nextLine());
		String[] numStrings = scan.nextLine().split(" ");
		int[] nums = new int[length];
		for(int i = 0; i < length; i++)
			nums[i] = Integer.parseInt(numStrings[i]);
		
		for(int n = 0; n < length; n++) {
			System.out.print(nums[n]);
			if(n < length - 1)
				System.out.print(" ");
		}
		System.out.println();
		
		for(int i = 1; i < nums.length; i++) {
			int current = nums[i];
			
			int index = 0;
			while(current > nums[index] && index < i)
				index++;
			
			for(int n = i; n > index; n--)
				nums[n] = nums[n - 1];
			
			nums[index] = current;
		
			for(int n = 0; n < length; n++) {
				System.out.print(nums[n]);
				if(n < length - 1)
					System.out.print(" ");
			}
			System.out.println();
		}
	}
} public class Main{
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int length = Integer.parseInt(scan.nextLine());
		String[] numStrings = scan.nextLine().split(" ");
		int[] nums = new int[length];
		for(int i = 0; i < length; i++)
			nums[i] = Integer.parseInt(numStrings[i]);
		
		for(int n = 0; n < length; n++) {
			System.out.print(nums[n]);
			if(n < length - 1)
				System.out.print(" ");
		}
		System.out.println();
		
		for(int i = 1; i < nums.length; i++) {
			int current = nums[i];
			
			int index = 0;
			while(current > nums[index] && index < i)
				index++;
			
			for(int n = i; n > index; n--)
				nums[n] = nums[n - 1];
			
			nums[index] = current;
		
			for(int n = 0; n < length; n++) {
				System.out.print(nums[n]);
				if(n < length - 1)
					System.out.print(" ");
			}
			System.out.println();
		}
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int length = Integer.parseInt(scan.nextLine());
		String[] numStrings = scan.nextLine().split(" ");
		int[] nums = new int[length];
		for(int i = 0; i < length; i++)
			nums[i] = Integer.parseInt(numStrings[i]);
		
		for(int n = 0; n < length; n++) {
			System.out.print(nums[n]);
			if(n < length - 1)
				System.out.print(" ");
		}
		System.out.println();
		
		for(int i = 1; i < nums.length; i++) {
			int current = nums[i];
			
			int index = 0;
			while(current > nums[index] && index < i)
				index++;
			
			for(int n = i; n > index; n--)
				nums[n] = nums[n - 1];
			
			nums[index] = current;
		
			for(int n = 0; n < length; n++) {
				System.out.print(nums[n]);
				if(n < length - 1)
					System.out.print(" ");
			}
			System.out.println();
		}
	}
}

