import java.util.Scanner;

public class Main {
	static int[] insertSort(int[] x) {
		int v,j;
		for(int i = 0;i < x.length;i++) {
			v = x[i];
			j = i - 1;
			while(j >= 0 && x[j] > v) {
				x[j + 1] = x[j];
				j--;
			}
			x[j + 1] = v;
			show(x);
		}
		return x;
	}
	static void show(int[] x) {
		for(int i = 0;i < x.length;i++) {
			System.out.print(x[i]);
			if(i + 1 != x.length) System.out.print(" ");
			else System.out.println();
		}
	}
	public static void main(String[] args) {
		Scanner number = new Scanner(System.in);
		int a  = number.nextInt();
		int[] x = new int[a];
		for(int i = 0;i < a;i++) {
			x[i] = number.nextInt();
		}
		insertSort(x);
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	static int[] insertSort(int[] x) {
		int v,j;
		for(int i = 0;i < x.length;i++) {
			v = x[i];
			j = i - 1;
			while(j >= 0 && x[j] > v) {
				x[j + 1] = x[j];
				j--;
			}
			x[j + 1] = v;
			show(x);
		}
		return x;
	}
	static void show(int[] x) {
		for(int i = 0;i < x.length;i++) {
			System.out.print(x[i]);
			if(i + 1 != x.length) System.out.print(" ");
			else System.out.println();
		}
	}
	public static void main(String[] args) {
		Scanner number = new Scanner(System.in);
		int a  = number.nextInt();
		int[] x = new int[a];
		for(int i = 0;i < a;i++) {
			x[i] = number.nextInt();
		}
		insertSort(x);
	}
} Main static int[] insertSort(int[] x) {
		int v,j;
		for(int i = 0;i < x.length;i++) {
			v = x[i];
			j = i - 1;
			while(j >= 0 && x[j] > v) {
				x[j + 1] = x[j];
				j--;
			}
			x[j + 1] = v;
			show(x);
		}
		return x;
	} insertSort {
		int v,j;
		for(int i = 0;i < x.length;i++) {
			v = x[i];
			j = i - 1;
			while(j >= 0 && x[j] > v) {
				x[j + 1] = x[j];
				j--;
			}
			x[j + 1] = v;
			show(x);
		}
		return x;
	} int v v j; j for(int i = 0;i < x.length;i++) {
			v = x[i];
			j = i - 1;
			while(j >= 0 && x[j] > v) {
				x[j + 1] = x[j];
				j--;
			}
			x[j + 1] = v;
			show(x);
		} int i = 0; int i = 0; i 0 i < x.length i x.length x x.length i++ i++ i {
			v = x[i];
			j = i - 1;
			while(j >= 0 && x[j] > v) {
				x[j + 1] = x[j];
				j--;
			}
			x[j + 1] = v;
			show(x);
		} {
			v = x[i];
			j = i - 1;
			while(j >= 0 && x[j] > v) {
				x[j + 1] = x[j];
				j--;
			}
			x[j + 1] = v;
			show(x);
		} v = x[i] v x[i] x i j = i - 1 j i - 1 i 1 while(j >= 0 && x[j] > v) {
				x[j + 1] = x[j];
				j--;
			} j >= 0 && x[j] > v j >= 0 j 0 x[j] > v x[j] x j v {
				x[j + 1] = x[j];
				j--;
			} x[j + 1] = x[j] x[j + 1] x j + 1 j 1 x[j] x j j-- j x[j + 1] = v x[j + 1] x j + 1 j 1 v show(x) show x return x; x int[] x x static void show(int[] x) {
		for(int i = 0;i < x.length;i++) {
			System.out.print(x[i]);
			if(i + 1 != x.length) System.out.print(" ");
			else System.out.println();
		}
	} show {
		for(int i = 0;i < x.length;i++) {
			System.out.print(x[i]);
			if(i + 1 != x.length) System.out.print(" ");
			else System.out.println();
		}
	} for(int i = 0;i < x.length;i++) {
			System.out.print(x[i]);
			if(i + 1 != x.length) System.out.print(" ");
			else System.out.println();
		} int i = 0; int i = 0; i 0 i < x.length i x.length x x.length i++ i++ i {
			System.out.print(x[i]);
			if(i + 1 != x.length) System.out.print(" ");
			else System.out.println();
		} {
			System.out.print(x[i]);
			if(i + 1 != x.length) System.out.print(" ");
			else System.out.println();
		} System.out.print(x[i]) System.out.print System.out System System.out x[i] x i if(i + 1 != x.length) System.out.print(" ");
			else System.out.println(); i + 1 != x.length i + 1 i 1 x.length x x.length System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out int[] x x public static void main(String[] args) {
		Scanner number = new Scanner(System.in);
		int a  = number.nextInt();
		int[] x = new int[a];
		for(int i = 0;i < a;i++) {
			x[i] = number.nextInt();
		}
		insertSort(x);
	} main {
		Scanner number = new Scanner(System.in);
		int a  = number.nextInt();
		int[] x = new int[a];
		for(int i = 0;i < a;i++) {
			x[i] = number.nextInt();
		}
		insertSort(x);
	} Scanner number = new Scanner(System.in); number new Scanner(System.in) int a  = number.nextInt(); a number.nextInt() number.nextInt number int[] x = new int[a]; x new int[a] a for(int i = 0;i < a;i++) {
			x[i] = number.nextInt();
		} int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
			x[i] = number.nextInt();
		} {
			x[i] = number.nextInt();
		} x[i] = number.nextInt() x[i] x i number.nextInt() number.nextInt number insertSort(x) insertSort x String[] args args public class Main {
	static int[] insertSort(int[] x) {
		int v,j;
		for(int i = 0;i < x.length;i++) {
			v = x[i];
			j = i - 1;
			while(j >= 0 && x[j] > v) {
				x[j + 1] = x[j];
				j--;
			}
			x[j + 1] = v;
			show(x);
		}
		return x;
	}
	static void show(int[] x) {
		for(int i = 0;i < x.length;i++) {
			System.out.print(x[i]);
			if(i + 1 != x.length) System.out.print(" ");
			else System.out.println();
		}
	}
	public static void main(String[] args) {
		Scanner number = new Scanner(System.in);
		int a  = number.nextInt();
		int[] x = new int[a];
		for(int i = 0;i < a;i++) {
			x[i] = number.nextInt();
		}
		insertSort(x);
	}
} public class Main {
	static int[] insertSort(int[] x) {
		int v,j;
		for(int i = 0;i < x.length;i++) {
			v = x[i];
			j = i - 1;
			while(j >= 0 && x[j] > v) {
				x[j + 1] = x[j];
				j--;
			}
			x[j + 1] = v;
			show(x);
		}
		return x;
	}
	static void show(int[] x) {
		for(int i = 0;i < x.length;i++) {
			System.out.print(x[i]);
			if(i + 1 != x.length) System.out.print(" ");
			else System.out.println();
		}
	}
	public static void main(String[] args) {
		Scanner number = new Scanner(System.in);
		int a  = number.nextInt();
		int[] x = new int[a];
		for(int i = 0;i < a;i++) {
			x[i] = number.nextInt();
		}
		insertSort(x);
	}
} Main
import java.util.Scanner;

public class Main {
	static int[] insertSort(int[] x) {
		int v,j;
		for(int i = 0;i < x.length;i++) {
			v = x[i];
			j = i - 1;
			while(j >= 0 && x[j] > v) {
				x[j + 1] = x[j];
				j--;
			}
			x[j + 1] = v;
			show(x);
		}
		return x;
	}
	static void show(int[] x) {
		for(int i = 0;i < x.length;i++) {
			System.out.print(x[i]);
			if(i + 1 != x.length) System.out.print(" ");
			else System.out.println();
		}
	}
	public static void main(String[] args) {
		Scanner number = new Scanner(System.in);
		int a  = number.nextInt();
		int[] x = new int[a];
		for(int i = 0;i < a;i++) {
			x[i] = number.nextInt();
		}
		insertSort(x);
	}
}

