/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = Integer.parseInt(scanner.nextLine());
		
		int[] A = new int[n];
		
		String[] arrayStr = scanner.nextLine().split(" ");
		
		for (int i = 0; i < n; i++) {
			A[i] = Integer.parseInt(arrayStr[i]);
		}
		
		printArray(A);
		
		int v,j;
		for (int i = 1; i < n; i++) {
			v = A[i];
			j = i - 1;
			
			while (j >= 0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			
			printArray(A);	
		}
		
	}
	
	static void printArray(int[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		}
		System.out.println();
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = Integer.parseInt(scanner.nextLine());
		
		int[] A = new int[n];
		
		String[] arrayStr = scanner.nextLine().split(" ");
		
		for (int i = 0; i < n; i++) {
			A[i] = Integer.parseInt(arrayStr[i]);
		}
		
		printArray(A);
		
		int v,j;
		for (int i = 1; i < n; i++) {
			v = A[i];
			j = i - 1;
			
			while (j >= 0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			
			printArray(A);	
		}
		
	}
	
	static void printArray(int[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		}
		System.out.println();
	}
} Main public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = Integer.parseInt(scanner.nextLine());
		
		int[] A = new int[n];
		
		String[] arrayStr = scanner.nextLine().split(" ");
		
		for (int i = 0; i < n; i++) {
			A[i] = Integer.parseInt(arrayStr[i]);
		}
		
		printArray(A);
		
		int v,j;
		for (int i = 1; i < n; i++) {
			v = A[i];
			j = i - 1;
			
			while (j >= 0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			
			printArray(A);	
		}
		
	} main {
		Scanner scanner = new Scanner(System.in);
		
		int n = Integer.parseInt(scanner.nextLine());
		
		int[] A = new int[n];
		
		String[] arrayStr = scanner.nextLine().split(" ");
		
		for (int i = 0; i < n; i++) {
			A[i] = Integer.parseInt(arrayStr[i]);
		}
		
		printArray(A);
		
		int v,j;
		for (int i = 1; i < n; i++) {
			v = A[i];
			j = i - 1;
			
			while (j >= 0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			
			printArray(A);	
		}
		
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = Integer.parseInt(scanner.nextLine()); n Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner int[] A = new int[n]; A new int[n] n String[] arrayStr = scanner.nextLine().split(" "); arrayStr scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " for (int i = 0; i < n; i++) {
			A[i] = Integer.parseInt(arrayStr[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			A[i] = Integer.parseInt(arrayStr[i]);
		} {
			A[i] = Integer.parseInt(arrayStr[i]);
		} A[i] = Integer.parseInt(arrayStr[i]) A[i] A i Integer.parseInt(arrayStr[i]) Integer.parseInt Integer arrayStr[i] arrayStr i printArray(A) printArray A int v v j; j for (int i = 1; i < n; i++) {
			v = A[i];
			j = i - 1;
			
			while (j >= 0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			
			printArray(A);	
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			v = A[i];
			j = i - 1;
			
			while (j >= 0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			
			printArray(A);	
		} {
			v = A[i];
			j = i - 1;
			
			while (j >= 0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			
			printArray(A);	
		} v = A[i] v A[i] A i j = i - 1 j i - 1 i 1 while (j >= 0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			} j >= 0 && A[j] > v j >= 0 j 0 A[j] > v A[j] A j v {
				A[j+1] = A[j];
				j--;
			} A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j j-- j A[j+1] = v A[j+1] A j+1 j 1 v printArray(A) printArray A String[] args args static void printArray(int[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		}
		System.out.println();
	} printArray {
		for (int i = 0; i < array.length; i++) {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		}
		System.out.println();
	} for (int i = 0; i < array.length; i++) {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		} int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i++ i++ i {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		} {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		} if (i > 0) {
				System.out.print(" ");
			} i > 0 i 0 {
				System.out.print(" ");
			} System.out.print(" ") System.out.print System.out System System.out " " System.out.print(array[i]) System.out.print System.out System System.out array[i] array i System.out.println() System.out.println System.out System System.out int[] array array
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = Integer.parseInt(scanner.nextLine());
		
		int[] A = new int[n];
		
		String[] arrayStr = scanner.nextLine().split(" ");
		
		for (int i = 0; i < n; i++) {
			A[i] = Integer.parseInt(arrayStr[i]);
		}
		
		printArray(A);
		
		int v,j;
		for (int i = 1; i < n; i++) {
			v = A[i];
			j = i - 1;
			
			while (j >= 0 && A[j] > v) {
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			
			printArray(A);	
		}
		
	}
	
	static void printArray(int[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(array[i]);
		}
		System.out.println();
	}
}
