import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		String x = "";
		try {
			int num = Integer.parseInt(in.readLine());
			
			x = in.readLine();
			String[] nums = x.split(" ");
			
			int[] a = new int[num];
			for (int i = 0; i < num; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}

			System.out.print(a[0]);
			for (int j = 1; j < num; j++) {
				System.out.print(" " + a[j]);
			}
			System.out.println();
			
			for (int i = 1; i < num; i++) {
				int key = a[i];
				
				int j = i - 1;
				while ((j >= 0) && (a[j] > key)) {
					a[j + 1] = a[j];
					j--;
					a[j + 1] = key;
				}
				
				System.out.print(a[0]);
				for (j = 1; j < num; j++) {
					System.out.print(" " + a[j]);
				}
				System.out.println();
			}
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		String x = "";
		try {
			int num = Integer.parseInt(in.readLine());
			
			x = in.readLine();
			String[] nums = x.split(" ");
			
			int[] a = new int[num];
			for (int i = 0; i < num; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}

			System.out.print(a[0]);
			for (int j = 1; j < num; j++) {
				System.out.print(" " + a[j]);
			}
			System.out.println();
			
			for (int i = 1; i < num; i++) {
				int key = a[i];
				
				int j = i - 1;
				while ((j >= 0) && (a[j] > key)) {
					a[j + 1] = a[j];
					j--;
					a[j + 1] = key;
				}
				
				System.out.print(a[0]);
				for (j = 1; j < num; j++) {
					System.out.print(" " + a[j]);
				}
				System.out.println();
			}
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
} Main public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		String x = "";
		try {
			int num = Integer.parseInt(in.readLine());
			
			x = in.readLine();
			String[] nums = x.split(" ");
			
			int[] a = new int[num];
			for (int i = 0; i < num; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}

			System.out.print(a[0]);
			for (int j = 1; j < num; j++) {
				System.out.print(" " + a[j]);
			}
			System.out.println();
			
			for (int i = 1; i < num; i++) {
				int key = a[i];
				
				int j = i - 1;
				while ((j >= 0) && (a[j] > key)) {
					a[j + 1] = a[j];
					j--;
					a[j + 1] = key;
				}
				
				System.out.print(a[0]);
				for (j = 1; j < num; j++) {
					System.out.print(" " + a[j]);
				}
				System.out.println();
			}
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		String x = "";
		try {
			int num = Integer.parseInt(in.readLine());
			
			x = in.readLine();
			String[] nums = x.split(" ");
			
			int[] a = new int[num];
			for (int i = 0; i < num; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}

			System.out.print(a[0]);
			for (int j = 1; j < num; j++) {
				System.out.print(" " + a[j]);
			}
			System.out.println();
			
			for (int i = 1; i < num; i++) {
				int key = a[i];
				
				int j = i - 1;
				while ((j >= 0) && (a[j] > key)) {
					a[j + 1] = a[j];
					j--;
					a[j + 1] = key;
				}
				
				System.out.print(a[0]);
				for (j = 1; j < num; j++) {
					System.out.print(" " + a[j]);
				}
				System.out.println();
			}
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String x = ""; x "" try {
			int num = Integer.parseInt(in.readLine());
			
			x = in.readLine();
			String[] nums = x.split(" ");
			
			int[] a = new int[num];
			for (int i = 0; i < num; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}

			System.out.print(a[0]);
			for (int j = 1; j < num; j++) {
				System.out.print(" " + a[j]);
			}
			System.out.println();
			
			for (int i = 1; i < num; i++) {
				int key = a[i];
				
				int j = i - 1;
				while ((j >= 0) && (a[j] > key)) {
					a[j + 1] = a[j];
					j--;
					a[j + 1] = key;
				}
				
				System.out.print(a[0]);
				for (j = 1; j < num; j++) {
					System.out.print(" " + a[j]);
				}
				System.out.println();
			}
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} NumberFormatException e {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} IOException e {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			int num = Integer.parseInt(in.readLine());
			
			x = in.readLine();
			String[] nums = x.split(" ");
			
			int[] a = new int[num];
			for (int i = 0; i < num; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}

			System.out.print(a[0]);
			for (int j = 1; j < num; j++) {
				System.out.print(" " + a[j]);
			}
			System.out.println();
			
			for (int i = 1; i < num; i++) {
				int key = a[i];
				
				int j = i - 1;
				while ((j >= 0) && (a[j] > key)) {
					a[j + 1] = a[j];
					j--;
					a[j + 1] = key;
				}
				
				System.out.print(a[0]);
				for (j = 1; j < num; j++) {
					System.out.print(" " + a[j]);
				}
				System.out.println();
			}
		} int num = Integer.parseInt(in.readLine()); num Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in x = in.readLine() x in.readLine() in.readLine in String[] nums = x.split(" "); nums x.split(" ") x.split x " " int[] a = new int[num]; a new int[num] num for (int i = 0; i < num; i++) {
				a[i] = Integer.parseInt(nums[i]);
			} int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
				a[i] = Integer.parseInt(nums[i]);
			} {
				a[i] = Integer.parseInt(nums[i]);
			} a[i] = Integer.parseInt(nums[i]) a[i] a i Integer.parseInt(nums[i]) Integer.parseInt Integer nums[i] nums i System.out.print(a[0]) System.out.print System.out System System.out a[0] a 0 for (int j = 1; j < num; j++) {
				System.out.print(" " + a[j]);
			} int j = 1; int j = 1; j 1 j < num j num j++ j++ j {
				System.out.print(" " + a[j]);
			} {
				System.out.print(" " + a[j]);
			} System.out.print(" " + a[j]) System.out.print System.out System System.out " " + a[j] " " a[j] a j System.out.println() System.out.println System.out System System.out for (int i = 1; i < num; i++) {
				int key = a[i];
				
				int j = i - 1;
				while ((j >= 0) && (a[j] > key)) {
					a[j + 1] = a[j];
					j--;
					a[j + 1] = key;
				}
				
				System.out.print(a[0]);
				for (j = 1; j < num; j++) {
					System.out.print(" " + a[j]);
				}
				System.out.println();
			} int i = 1; int i = 1; i 1 i < num i num i++ i++ i {
				int key = a[i];
				
				int j = i - 1;
				while ((j >= 0) && (a[j] > key)) {
					a[j + 1] = a[j];
					j--;
					a[j + 1] = key;
				}
				
				System.out.print(a[0]);
				for (j = 1; j < num; j++) {
					System.out.print(" " + a[j]);
				}
				System.out.println();
			} {
				int key = a[i];
				
				int j = i - 1;
				while ((j >= 0) && (a[j] > key)) {
					a[j + 1] = a[j];
					j--;
					a[j + 1] = key;
				}
				
				System.out.print(a[0]);
				for (j = 1; j < num; j++) {
					System.out.print(" " + a[j]);
				}
				System.out.println();
			} int key = a[i]; key a[i] a i int j = i - 1; j i - 1 i 1 while ((j >= 0) && (a[j] > key)) {
					a[j + 1] = a[j];
					j--;
					a[j + 1] = key;
				} (j >= 0) && (a[j] > key) (j >= 0) j 0 (a[j] > key) a[j] a j key {
					a[j + 1] = a[j];
					j--;
					a[j + 1] = key;
				} a[j + 1] = a[j] a[j + 1] a j + 1 j 1 a[j] a j j-- j a[j + 1] = key a[j + 1] a j + 1 j 1 key System.out.print(a[0]) System.out.print System.out System System.out a[0] a 0 for (j = 1; j < num; j++) {
					System.out.print(" " + a[j]);
				} j = 1; j = 1 j 1 j < num j num j++ j++ j {
					System.out.print(" " + a[j]);
				} {
					System.out.print(" " + a[j]);
				} System.out.print(" " + a[j]) System.out.print System.out System System.out " " + a[j] " " a[j] a j System.out.println() System.out.println System.out System System.out String[] args args public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		String x = "";
		try {
			int num = Integer.parseInt(in.readLine());
			
			x = in.readLine();
			String[] nums = x.split(" ");
			
			int[] a = new int[num];
			for (int i = 0; i < num; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}

			System.out.print(a[0]);
			for (int j = 1; j < num; j++) {
				System.out.print(" " + a[j]);
			}
			System.out.println();
			
			for (int i = 1; i < num; i++) {
				int key = a[i];
				
				int j = i - 1;
				while ((j >= 0) && (a[j] > key)) {
					a[j + 1] = a[j];
					j--;
					a[j + 1] = key;
				}
				
				System.out.print(a[0]);
				for (j = 1; j < num; j++) {
					System.out.print(" " + a[j]);
				}
				System.out.println();
			}
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
} public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		String x = "";
		try {
			int num = Integer.parseInt(in.readLine());
			
			x = in.readLine();
			String[] nums = x.split(" ");
			
			int[] a = new int[num];
			for (int i = 0; i < num; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}

			System.out.print(a[0]);
			for (int j = 1; j < num; j++) {
				System.out.print(" " + a[j]);
			}
			System.out.println();
			
			for (int i = 1; i < num; i++) {
				int key = a[i];
				
				int j = i - 1;
				while ((j >= 0) && (a[j] > key)) {
					a[j + 1] = a[j];
					j--;
					a[j + 1] = key;
				}
				
				System.out.print(a[0]);
				for (j = 1; j < num; j++) {
					System.out.print(" " + a[j]);
				}
				System.out.println();
			}
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		String x = "";
		try {
			int num = Integer.parseInt(in.readLine());
			
			x = in.readLine();
			String[] nums = x.split(" ");
			
			int[] a = new int[num];
			for (int i = 0; i < num; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}

			System.out.print(a[0]);
			for (int j = 1; j < num; j++) {
				System.out.print(" " + a[j]);
			}
			System.out.println();
			
			for (int i = 1; i < num; i++) {
				int key = a[i];
				
				int j = i - 1;
				while ((j >= 0) && (a[j] > key)) {
					a[j + 1] = a[j];
					j--;
					a[j + 1] = key;
				}
				
				System.out.print(a[0]);
				for (j = 1; j < num; j++) {
					System.out.print(" " + a[j]);
				}
				System.out.println();
			}
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}