import java.util.Scanner;
public class Main {
	int n;
	int[] array;
	public static void main(String args[]) {
		Main main = new Main();
	}
	Main() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = scan.nextInt();
		}
		this.writeArray();
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			for(; j >= 0 && array[j] > v; j--) {
				array[j+1] = array[j];
			}
			array[j+1] = v;
			this.writeArray();
		}
	}
	public void writeArray() {
		for (int i = 0; i < n; i++) {
			if (i < n - 1)
				System.out.print(array[i] + " ");
			else
				System.out.println(array[i]);
		}
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	int n;
	int[] array;
	public static void main(String args[]) {
		Main main = new Main();
	}
	Main() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = scan.nextInt();
		}
		this.writeArray();
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			for(; j >= 0 && array[j] > v; j--) {
				array[j+1] = array[j];
			}
			array[j+1] = v;
			this.writeArray();
		}
	}
	public void writeArray() {
		for (int i = 0; i < n; i++) {
			if (i < n - 1)
				System.out.print(array[i] + " ");
			else
				System.out.println(array[i]);
		}
	}
} Main int n; n int[] array; array public static void main(String args[]) {
		Main main = new Main();
	} main {
		Main main = new Main();
	} Main main = new Main(); main new Main() String args[] args Main() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = scan.nextInt();
		}
		this.writeArray();
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			for(; j >= 0 && array[j] > v; j--) {
				array[j+1] = array[j];
			}
			array[j+1] = v;
			this.writeArray();
		}
	} Main {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = scan.nextInt();
		}
		this.writeArray();
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			for(; j >= 0 && array[j] > v; j--) {
				array[j+1] = array[j];
			}
			array[j+1] = v;
			this.writeArray();
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) n = scan.nextInt() n scan.nextInt() scan.nextInt scan array = new int[n] array new int[n] n for (int i = 0; i < n; i++) {
			array[i] = scan.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			array[i] = scan.nextInt();
		} {
			array[i] = scan.nextInt();
		} array[i] = scan.nextInt() array[i] array i scan.nextInt() scan.nextInt scan this.writeArray() this.writeArray this for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			for(; j >= 0 && array[j] > v; j--) {
				array[j+1] = array[j];
			}
			array[j+1] = v;
			this.writeArray();
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			int v = array[i];
			int j = i - 1;
			for(; j >= 0 && array[j] > v; j--) {
				array[j+1] = array[j];
			}
			array[j+1] = v;
			this.writeArray();
		} {
			int v = array[i];
			int j = i - 1;
			for(; j >= 0 && array[j] > v; j--) {
				array[j+1] = array[j];
			}
			array[j+1] = v;
			this.writeArray();
		} int v = array[i]; v array[i] array i int j = i - 1; j i - 1 i 1 for(; j >= 0 && array[j] > v; j--) {
				array[j+1] = array[j];
			} ; j >= 0 && array[j] > v j >= 0 j 0 array[j] > v array[j] array j v j-- j-- j {
				array[j+1] = array[j];
			} {
				array[j+1] = array[j];
			} array[j+1] = array[j] array[j+1] array j+1 j 1 array[j] array j array[j+1] = v array[j+1] array j+1 j 1 v this.writeArray() this.writeArray this public void writeArray() {
		for (int i = 0; i < n; i++) {
			if (i < n - 1)
				System.out.print(array[i] + " ");
			else
				System.out.println(array[i]);
		}
	} writeArray {
		for (int i = 0; i < n; i++) {
			if (i < n - 1)
				System.out.print(array[i] + " ");
			else
				System.out.println(array[i]);
		}
	} for (int i = 0; i < n; i++) {
			if (i < n - 1)
				System.out.print(array[i] + " ");
			else
				System.out.println(array[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (i < n - 1)
				System.out.print(array[i] + " ");
			else
				System.out.println(array[i]);
		} {
			if (i < n - 1)
				System.out.print(array[i] + " ");
			else
				System.out.println(array[i]);
		} if (i < n - 1)
				System.out.print(array[i] + " ");
			else
				System.out.println(array[i]); i < n - 1 i n - 1 n 1 System.out.print(array[i] + " ") System.out.print System.out System System.out array[i] + " " array[i] array i " " System.out.println(array[i]) System.out.println System.out System System.out array[i] array i public class Main {
	int n;
	int[] array;
	public static void main(String args[]) {
		Main main = new Main();
	}
	Main() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = scan.nextInt();
		}
		this.writeArray();
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			for(; j >= 0 && array[j] > v; j--) {
				array[j+1] = array[j];
			}
			array[j+1] = v;
			this.writeArray();
		}
	}
	public void writeArray() {
		for (int i = 0; i < n; i++) {
			if (i < n - 1)
				System.out.print(array[i] + " ");
			else
				System.out.println(array[i]);
		}
	}
} public class Main {
	int n;
	int[] array;
	public static void main(String args[]) {
		Main main = new Main();
	}
	Main() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = scan.nextInt();
		}
		this.writeArray();
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			for(; j >= 0 && array[j] > v; j--) {
				array[j+1] = array[j];
			}
			array[j+1] = v;
			this.writeArray();
		}
	}
	public void writeArray() {
		for (int i = 0; i < n; i++) {
			if (i < n - 1)
				System.out.print(array[i] + " ");
			else
				System.out.println(array[i]);
		}
	}
} Main
import java.util.Scanner;
public class Main {
	int n;
	int[] array;
	public static void main(String args[]) {
		Main main = new Main();
	}
	Main() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = scan.nextInt();
		}
		this.writeArray();
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			for(; j >= 0 && array[j] > v; j--) {
				array[j+1] = array[j];
			}
			array[j+1] = v;
			this.writeArray();
		}
	}
	public void writeArray() {
		for (int i = 0; i < n; i++) {
			if (i < n - 1)
				System.out.print(array[i] + " ");
			else
				System.out.println(array[i]);
		}
	}
}

