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

public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		
		String line = br.readLine();
		String[] numbers = line.split(" ");
		int[] a = new int[n];
		
		for (int i = 0; i < numbers.length; i++) {
			a[i] = Integer.parseInt(numbers[i]);
		}
		
		printLine(a);
		
		for (int i = 1; i <= a.length - 1; i++) {
			int v = a[i];
			int j = i - 1;
			
			while(j >= 0 && a[j] > v){
				a[j + 1] = a[j];
				j--;
			}
			
			a[j + 1] = v;
			
			printLine(a);
			
		}
		
	}
	
	static void printLine (int[] b){
		String st = Integer.toString(b[0]);
		for (int k = 1; k < b.length; k++) {
			st += " " + b[k];
		}
		System.out.println(st);
	}
} 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) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		
		String line = br.readLine();
		String[] numbers = line.split(" ");
		int[] a = new int[n];
		
		for (int i = 0; i < numbers.length; i++) {
			a[i] = Integer.parseInt(numbers[i]);
		}
		
		printLine(a);
		
		for (int i = 1; i <= a.length - 1; i++) {
			int v = a[i];
			int j = i - 1;
			
			while(j >= 0 && a[j] > v){
				a[j + 1] = a[j];
				j--;
			}
			
			a[j + 1] = v;
			
			printLine(a);
			
		}
		
	}
	
	static void printLine (int[] b){
		String st = Integer.toString(b[0]);
		for (int k = 1; k < b.length; k++) {
			st += " " + b[k];
		}
		System.out.println(st);
	}
} Main public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		
		String line = br.readLine();
		String[] numbers = line.split(" ");
		int[] a = new int[n];
		
		for (int i = 0; i < numbers.length; i++) {
			a[i] = Integer.parseInt(numbers[i]);
		}
		
		printLine(a);
		
		for (int i = 1; i <= a.length - 1; i++) {
			int v = a[i];
			int j = i - 1;
			
			while(j >= 0 && a[j] > v){
				a[j + 1] = a[j];
				j--;
			}
			
			a[j + 1] = v;
			
			printLine(a);
			
		}
		
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		
		String line = br.readLine();
		String[] numbers = line.split(" ");
		int[] a = new int[n];
		
		for (int i = 0; i < numbers.length; i++) {
			a[i] = Integer.parseInt(numbers[i]);
		}
		
		printLine(a);
		
		for (int i = 1; i <= a.length - 1; i++) {
			int v = a[i];
			int j = i - 1;
			
			while(j >= 0 && a[j] > v){
				a[j + 1] = a[j];
				j--;
			}
			
			a[j + 1] = v;
			
			printLine(a);
			
		}
		
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String line = br.readLine(); line br.readLine() br.readLine br String[] numbers = line.split(" "); numbers line.split(" ") line.split line " " int[] a = new int[n]; a new int[n] n for (int i = 0; i < numbers.length; i++) {
			a[i] = Integer.parseInt(numbers[i]);
		} int i = 0; int i = 0; i 0 i < numbers.length i numbers.length numbers numbers.length i++ i++ i {
			a[i] = Integer.parseInt(numbers[i]);
		} {
			a[i] = Integer.parseInt(numbers[i]);
		} a[i] = Integer.parseInt(numbers[i]) a[i] a i Integer.parseInt(numbers[i]) Integer.parseInt Integer numbers[i] numbers i printLine(a) printLine a for (int i = 1; i <= a.length - 1; i++) {
			int v = a[i];
			int j = i - 1;
			
			while(j >= 0 && a[j] > v){
				a[j + 1] = a[j];
				j--;
			}
			
			a[j + 1] = v;
			
			printLine(a);
			
		} int i = 1; int i = 1; i 1 i <= a.length - 1 i a.length - 1 a.length a a.length 1 i++ i++ i {
			int v = a[i];
			int j = i - 1;
			
			while(j >= 0 && a[j] > v){
				a[j + 1] = a[j];
				j--;
			}
			
			a[j + 1] = v;
			
			printLine(a);
			
		} {
			int v = a[i];
			int j = i - 1;
			
			while(j >= 0 && a[j] > v){
				a[j + 1] = a[j];
				j--;
			}
			
			a[j + 1] = v;
			
			printLine(a);
			
		} int v = a[i]; v a[i] a i int 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 printLine(a) printLine a String[] args args static void printLine (int[] b){
		String st = Integer.toString(b[0]);
		for (int k = 1; k < b.length; k++) {
			st += " " + b[k];
		}
		System.out.println(st);
	} printLine {
		String st = Integer.toString(b[0]);
		for (int k = 1; k < b.length; k++) {
			st += " " + b[k];
		}
		System.out.println(st);
	} String st = Integer.toString(b[0]); st Integer.toString(b[0]) Integer.toString Integer b[0] b 0 for (int k = 1; k < b.length; k++) {
			st += " " + b[k];
		} int k = 1; int k = 1; k 1 k < b.length k b.length b b.length k++ k++ k {
			st += " " + b[k];
		} {
			st += " " + b[k];
		} st += " " + b[k] st " " + b[k] " " b[k] b k System.out.println(st) System.out.println System.out System System.out st int[] b b public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		
		String line = br.readLine();
		String[] numbers = line.split(" ");
		int[] a = new int[n];
		
		for (int i = 0; i < numbers.length; i++) {
			a[i] = Integer.parseInt(numbers[i]);
		}
		
		printLine(a);
		
		for (int i = 1; i <= a.length - 1; i++) {
			int v = a[i];
			int j = i - 1;
			
			while(j >= 0 && a[j] > v){
				a[j + 1] = a[j];
				j--;
			}
			
			a[j + 1] = v;
			
			printLine(a);
			
		}
		
	}
	
	static void printLine (int[] b){
		String st = Integer.toString(b[0]);
		for (int k = 1; k < b.length; k++) {
			st += " " + b[k];
		}
		System.out.println(st);
	}
} public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		
		String line = br.readLine();
		String[] numbers = line.split(" ");
		int[] a = new int[n];
		
		for (int i = 0; i < numbers.length; i++) {
			a[i] = Integer.parseInt(numbers[i]);
		}
		
		printLine(a);
		
		for (int i = 1; i <= a.length - 1; i++) {
			int v = a[i];
			int j = i - 1;
			
			while(j >= 0 && a[j] > v){
				a[j + 1] = a[j];
				j--;
			}
			
			a[j + 1] = v;
			
			printLine(a);
			
		}
		
	}
	
	static void printLine (int[] b){
		String st = Integer.toString(b[0]);
		for (int k = 1; k < b.length; k++) {
			st += " " + b[k];
		}
		System.out.println(st);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		
		String line = br.readLine();
		String[] numbers = line.split(" ");
		int[] a = new int[n];
		
		for (int i = 0; i < numbers.length; i++) {
			a[i] = Integer.parseInt(numbers[i]);
		}
		
		printLine(a);
		
		for (int i = 1; i <= a.length - 1; i++) {
			int v = a[i];
			int j = i - 1;
			
			while(j >= 0 && a[j] > v){
				a[j + 1] = a[j];
				j--;
			}
			
			a[j + 1] = v;
			
			printLine(a);
			
		}
		
	}
	
	static void printLine (int[] b){
		String st = Integer.toString(b[0]);
		for (int k = 1; k < b.length; k++) {
			st += " " + b[k];
		}
		System.out.println(st);
	}
}