

import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		
		int length = in.nextInt();
		int array[] = new int[length];
		
		for (int i = 0; i < length; i++) {
			array[i] = in.nextInt();
		}
		print(array);
		
		for (int i = 1; i < length; i++) {
			int key = array[i]; // this is the reference value
			int j = i - 1;
			
			while (j >=0 && array[j] > key) // go backwards
			{
				array[j+1] = array[j];
				j = j-1; // decrement j
			}
			array[j+1] = key;
			print(array);
		}
		
		in.close();
		
	}
	public static void print(int array[]) {
		System.out.print(array[0]);
		for (int i = 1; i < array.length; i++) {
			System.out.print(" " + array[i]);
		}
		System.out.print("\n");
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		
		int length = in.nextInt();
		int array[] = new int[length];
		
		for (int i = 0; i < length; i++) {
			array[i] = in.nextInt();
		}
		print(array);
		
		for (int i = 1; i < length; i++) {
			int key = array[i]; // this is the reference value
			int j = i - 1;
			
			while (j >=0 && array[j] > key) // go backwards
			{
				array[j+1] = array[j];
				j = j-1; // decrement j
			}
			array[j+1] = key;
			print(array);
		}
		
		in.close();
		
	}
	public static void print(int array[]) {
		System.out.print(array[0]);
		for (int i = 1; i < array.length; i++) {
			System.out.print(" " + array[i]);
		}
		System.out.print("\n");
	}
} Main public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		
		int length = in.nextInt();
		int array[] = new int[length];
		
		for (int i = 0; i < length; i++) {
			array[i] = in.nextInt();
		}
		print(array);
		
		for (int i = 1; i < length; i++) {
			int key = array[i]; // this is the reference value
			int j = i - 1;
			
			while (j >=0 && array[j] > key) // go backwards
			{
				array[j+1] = array[j];
				j = j-1; // decrement j
			}
			array[j+1] = key;
			print(array);
		}
		
		in.close();
		
	} main {
		Scanner in = new Scanner(System.in);
		
		int length = in.nextInt();
		int array[] = new int[length];
		
		for (int i = 0; i < length; i++) {
			array[i] = in.nextInt();
		}
		print(array);
		
		for (int i = 1; i < length; i++) {
			int key = array[i]; // this is the reference value
			int j = i - 1;
			
			while (j >=0 && array[j] > key) // go backwards
			{
				array[j+1] = array[j];
				j = j-1; // decrement j
			}
			array[j+1] = key;
			print(array);
		}
		
		in.close();
		
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int length = in.nextInt(); length in.nextInt() in.nextInt in int array[] = new int[length]; array new int[length] length for (int i = 0; i < length; i++) {
			array[i] = in.nextInt();
		} int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
			array[i] = in.nextInt();
		} {
			array[i] = in.nextInt();
		} array[i] = in.nextInt() array[i] array i in.nextInt() in.nextInt in print(array) print array for (int i = 1; i < length; i++) {
			int key = array[i]; // this is the reference value
			int j = i - 1;
			
			while (j >=0 && array[j] > key) // go backwards
			{
				array[j+1] = array[j];
				j = j-1; // decrement j
			}
			array[j+1] = key;
			print(array);
		} int i = 1; int i = 1; i 1 i < length i length i++ i++ i {
			int key = array[i]; // this is the reference value
			int j = i - 1;
			
			while (j >=0 && array[j] > key) // go backwards
			{
				array[j+1] = array[j];
				j = j-1; // decrement j
			}
			array[j+1] = key;
			print(array);
		} {
			int key = array[i]; // this is the reference value
			int j = i - 1;
			
			while (j >=0 && array[j] > key) // go backwards
			{
				array[j+1] = array[j];
				j = j-1; // decrement j
			}
			array[j+1] = key;
			print(array);
		} int key = array[i]; key array[i] array i int j = i - 1; j i - 1 i 1 while (j >=0 && array[j] > key) // go backwards
			{
				array[j+1] = array[j];
				j = j-1; // decrement j
			} j >=0 && array[j] > key j >=0 j 0 array[j] > key array[j] array j key {
				array[j+1] = array[j];
				j = j-1; // decrement j
			} array[j+1] = array[j] array[j+1] array j+1 j 1 array[j] array j j = j-1 j j-1 j 1 array[j+1] = key array[j+1] array j+1 j 1 key print(array) print array in.close() in.close in String args[] args public static void print(int array[]) {
		System.out.print(array[0]);
		for (int i = 1; i < array.length; i++) {
			System.out.print(" " + array[i]);
		}
		System.out.print("\n");
	} print {
		System.out.print(array[0]);
		for (int i = 1; i < array.length; i++) {
			System.out.print(" " + array[i]);
		}
		System.out.print("\n");
	} System.out.print(array[0]) System.out.print System.out System System.out array[0] array 0 for (int i = 1; i < array.length; i++) {
			System.out.print(" " + array[i]);
		} int i = 1; int i = 1; i 1 i < array.length i array.length array array.length i++ i++ i {
			System.out.print(" " + array[i]);
		} {
			System.out.print(" " + array[i]);
		} System.out.print(" " + array[i]) System.out.print System.out System System.out " " + array[i] " " array[i] array i System.out.print("\n") System.out.print System.out System System.out "\n" int array[] array public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		
		int length = in.nextInt();
		int array[] = new int[length];
		
		for (int i = 0; i < length; i++) {
			array[i] = in.nextInt();
		}
		print(array);
		
		for (int i = 1; i < length; i++) {
			int key = array[i]; // this is the reference value
			int j = i - 1;
			
			while (j >=0 && array[j] > key) // go backwards
			{
				array[j+1] = array[j];
				j = j-1; // decrement j
			}
			array[j+1] = key;
			print(array);
		}
		
		in.close();
		
	}
	public static void print(int array[]) {
		System.out.print(array[0]);
		for (int i = 1; i < array.length; i++) {
			System.out.print(" " + array[i]);
		}
		System.out.print("\n");
	}
} public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		
		int length = in.nextInt();
		int array[] = new int[length];
		
		for (int i = 0; i < length; i++) {
			array[i] = in.nextInt();
		}
		print(array);
		
		for (int i = 1; i < length; i++) {
			int key = array[i]; // this is the reference value
			int j = i - 1;
			
			while (j >=0 && array[j] > key) // go backwards
			{
				array[j+1] = array[j];
				j = j-1; // decrement j
			}
			array[j+1] = key;
			print(array);
		}
		
		in.close();
		
	}
	public static void print(int array[]) {
		System.out.print(array[0]);
		for (int i = 1; i < array.length; i++) {
			System.out.print(" " + array[i]);
		}
		System.out.print("\n");
	}
} Main


import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		
		int length = in.nextInt();
		int array[] = new int[length];
		
		for (int i = 0; i < length; i++) {
			array[i] = in.nextInt();
		}
		print(array);
		
		for (int i = 1; i < length; i++) {
			int key = array[i]; // this is the reference value
			int j = i - 1;
			
			while (j >=0 && array[j] > key) // go backwards
			{
				array[j+1] = array[j];
				j = j-1; // decrement j
			}
			array[j+1] = key;
			print(array);
		}
		
		in.close();
		
	}
	public static void print(int array[]) {
		System.out.print(array[0]);
		for (int i = 1; i < array.length; i++) {
			System.out.print(" " + array[i]);
		}
		System.out.print("\n");
	}
}

