import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		List<String> sl = Arrays.asList(br.readLine().trim().split(" "));
		List<Integer> il = new ArrayList<>();
		for (String s : sl) {
			il.add(Integer.parseInt(s));
		}

		insertionSort(il, n);
	}

	static void insertionSort(List<Integer> l, int n) {
		printList(l);
		for (int i=1; i<n; i++) {
			int v = l.get(i);
			int j = i - 1;
			while (j >= 0 && l.get(j) > v) {
				l.set(j + 1, l.get(j));
				j--;
			}
			l.set(j + 1, v);
			printList(l);
		}
	}
	
	static void printList(List<Integer> l) {
		Iterator<Integer> it = l.iterator();
		while(it.hasNext()) {
			System.out.print(it.next());
			if (it.hasNext()) System.out.print(" ");
		}
		
		System.out.println();
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Iterator; Iterator java.util import java.util.List; List java.util public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		List<String> sl = Arrays.asList(br.readLine().trim().split(" "));
		List<Integer> il = new ArrayList<>();
		for (String s : sl) {
			il.add(Integer.parseInt(s));
		}

		insertionSort(il, n);
	}

	static void insertionSort(List<Integer> l, int n) {
		printList(l);
		for (int i=1; i<n; i++) {
			int v = l.get(i);
			int j = i - 1;
			while (j >= 0 && l.get(j) > v) {
				l.set(j + 1, l.get(j));
				j--;
			}
			l.set(j + 1, v);
			printList(l);
		}
	}
	
	static void printList(List<Integer> l) {
		Iterator<Integer> it = l.iterator();
		while(it.hasNext()) {
			System.out.print(it.next());
			if (it.hasNext()) System.out.print(" ");
		}
		
		System.out.println();
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		List<String> sl = Arrays.asList(br.readLine().trim().split(" "));
		List<Integer> il = new ArrayList<>();
		for (String s : sl) {
			il.add(Integer.parseInt(s));
		}

		insertionSort(il, n);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		List<String> sl = Arrays.asList(br.readLine().trim().split(" "));
		List<Integer> il = new ArrayList<>();
		for (String s : sl) {
			il.add(Integer.parseInt(s));
		}

		insertionSort(il, n);
	} 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 List<String> sl = Arrays.asList(br.readLine().trim().split(" ")); sl Arrays.asList(br.readLine().trim().split(" ")) Arrays.asList Arrays br.readLine().trim().split(" ") br.readLine().trim().split br.readLine().trim() br.readLine().trim br.readLine() br.readLine br " " List<Integer> il = new ArrayList<>(); il new ArrayList<>() for (String s : sl) {
			il.add(Integer.parseInt(s));
		} String s sl {
			il.add(Integer.parseInt(s));
		} {
			il.add(Integer.parseInt(s));
		} il.add(Integer.parseInt(s)) il.add il Integer.parseInt(s) Integer.parseInt Integer s insertionSort(il, n) insertionSort il n String[] args args static void insertionSort(List<Integer> l, int n) {
		printList(l);
		for (int i=1; i<n; i++) {
			int v = l.get(i);
			int j = i - 1;
			while (j >= 0 && l.get(j) > v) {
				l.set(j + 1, l.get(j));
				j--;
			}
			l.set(j + 1, v);
			printList(l);
		}
	} insertionSort {
		printList(l);
		for (int i=1; i<n; i++) {
			int v = l.get(i);
			int j = i - 1;
			while (j >= 0 && l.get(j) > v) {
				l.set(j + 1, l.get(j));
				j--;
			}
			l.set(j + 1, v);
			printList(l);
		}
	} printList(l) printList l for (int i=1; i<n; i++) {
			int v = l.get(i);
			int j = i - 1;
			while (j >= 0 && l.get(j) > v) {
				l.set(j + 1, l.get(j));
				j--;
			}
			l.set(j + 1, v);
			printList(l);
		} int i=1; int i=1; i 1 i<n i n i++ i++ i {
			int v = l.get(i);
			int j = i - 1;
			while (j >= 0 && l.get(j) > v) {
				l.set(j + 1, l.get(j));
				j--;
			}
			l.set(j + 1, v);
			printList(l);
		} {
			int v = l.get(i);
			int j = i - 1;
			while (j >= 0 && l.get(j) > v) {
				l.set(j + 1, l.get(j));
				j--;
			}
			l.set(j + 1, v);
			printList(l);
		} int v = l.get(i); v l.get(i) l.get l i int j = i - 1; j i - 1 i 1 while (j >= 0 && l.get(j) > v) {
				l.set(j + 1, l.get(j));
				j--;
			} j >= 0 && l.get(j) > v j >= 0 j 0 l.get(j) > v l.get(j) l.get l j v {
				l.set(j + 1, l.get(j));
				j--;
			} l.set(j + 1, l.get(j)) l.set l j + 1 j 1 l.get(j) l.get l j j-- j l.set(j + 1, v) l.set l j + 1 j 1 v printList(l) printList l List<Integer> l l int n n static void printList(List<Integer> l) {
		Iterator<Integer> it = l.iterator();
		while(it.hasNext()) {
			System.out.print(it.next());
			if (it.hasNext()) System.out.print(" ");
		}
		
		System.out.println();
	} printList {
		Iterator<Integer> it = l.iterator();
		while(it.hasNext()) {
			System.out.print(it.next());
			if (it.hasNext()) System.out.print(" ");
		}
		
		System.out.println();
	} Iterator<Integer> it = l.iterator(); it l.iterator() l.iterator l while(it.hasNext()) {
			System.out.print(it.next());
			if (it.hasNext()) System.out.print(" ");
		} it.hasNext() it.hasNext it {
			System.out.print(it.next());
			if (it.hasNext()) System.out.print(" ");
		} System.out.print(it.next()) System.out.print System.out System System.out it.next() it.next it if (it.hasNext()) System.out.print(" "); it.hasNext() it.hasNext it System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out List<Integer> l l public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		List<String> sl = Arrays.asList(br.readLine().trim().split(" "));
		List<Integer> il = new ArrayList<>();
		for (String s : sl) {
			il.add(Integer.parseInt(s));
		}

		insertionSort(il, n);
	}

	static void insertionSort(List<Integer> l, int n) {
		printList(l);
		for (int i=1; i<n; i++) {
			int v = l.get(i);
			int j = i - 1;
			while (j >= 0 && l.get(j) > v) {
				l.set(j + 1, l.get(j));
				j--;
			}
			l.set(j + 1, v);
			printList(l);
		}
	}
	
	static void printList(List<Integer> l) {
		Iterator<Integer> it = l.iterator();
		while(it.hasNext()) {
			System.out.print(it.next());
			if (it.hasNext()) System.out.print(" ");
		}
		
		System.out.println();
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		List<String> sl = Arrays.asList(br.readLine().trim().split(" "));
		List<Integer> il = new ArrayList<>();
		for (String s : sl) {
			il.add(Integer.parseInt(s));
		}

		insertionSort(il, n);
	}

	static void insertionSort(List<Integer> l, int n) {
		printList(l);
		for (int i=1; i<n; i++) {
			int v = l.get(i);
			int j = i - 1;
			while (j >= 0 && l.get(j) > v) {
				l.set(j + 1, l.get(j));
				j--;
			}
			l.set(j + 1, v);
			printList(l);
		}
	}
	
	static void printList(List<Integer> l) {
		Iterator<Integer> it = l.iterator();
		while(it.hasNext()) {
			System.out.print(it.next());
			if (it.hasNext()) System.out.print(" ");
		}
		
		System.out.println();
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		List<String> sl = Arrays.asList(br.readLine().trim().split(" "));
		List<Integer> il = new ArrayList<>();
		for (String s : sl) {
			il.add(Integer.parseInt(s));
		}

		insertionSort(il, n);
	}

	static void insertionSort(List<Integer> l, int n) {
		printList(l);
		for (int i=1; i<n; i++) {
			int v = l.get(i);
			int j = i - 1;
			while (j >= 0 && l.get(j) > v) {
				l.set(j + 1, l.get(j));
				j--;
			}
			l.set(j + 1, v);
			printList(l);
		}
	}
	
	static void printList(List<Integer> l) {
		Iterator<Integer> it = l.iterator();
		while(it.hasNext()) {
			System.out.print(it.next());
			if (it.hasNext()) System.out.print(" ");
		}
		
		System.out.println();
	}
}