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

class Main {

	public static void main(String[] args) throws IOException {

		StringBuilder buider = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String n = br.readLine();

		String[] Snums = br.readLine().split(" ");

		int[]  nums = new int[Integer.parseInt(n)];

		for(int i= 0; i<Integer.parseInt(n); i++){
			nums[i]  = Integer.parseInt(Snums[i]);
		}
		int key =0;
		int j=0;
		for(int i=1; i<nums.length; i++){
			key = nums[i];
			j = i-1;
			for(int k=0; k<nums.length; k++){
				buider.append(nums[k]);
				if(k != nums.length-1){
				buider.append(" ");
				}
			}
			System.out.println(buider.toString());
			buider.setLength(0);
			while (j>=0 && nums[j]>key) {
				nums[j+1] =nums[j];
				j--;
			}
			nums[j+1] =key;
		}
		for(int k=0; k<nums.length; k++){
			buider.append(nums[k]);
			if(k != nums.length-1){
			buider.append(" ");
			}
		}
		System.out.println(buider.toString());



	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {

	public static void main(String[] args) throws IOException {

		StringBuilder buider = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String n = br.readLine();

		String[] Snums = br.readLine().split(" ");

		int[]  nums = new int[Integer.parseInt(n)];

		for(int i= 0; i<Integer.parseInt(n); i++){
			nums[i]  = Integer.parseInt(Snums[i]);
		}
		int key =0;
		int j=0;
		for(int i=1; i<nums.length; i++){
			key = nums[i];
			j = i-1;
			for(int k=0; k<nums.length; k++){
				buider.append(nums[k]);
				if(k != nums.length-1){
				buider.append(" ");
				}
			}
			System.out.println(buider.toString());
			buider.setLength(0);
			while (j>=0 && nums[j]>key) {
				nums[j+1] =nums[j];
				j--;
			}
			nums[j+1] =key;
		}
		for(int k=0; k<nums.length; k++){
			buider.append(nums[k]);
			if(k != nums.length-1){
			buider.append(" ");
			}
		}
		System.out.println(buider.toString());



	}

} Main public static void main(String[] args) throws IOException {

		StringBuilder buider = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String n = br.readLine();

		String[] Snums = br.readLine().split(" ");

		int[]  nums = new int[Integer.parseInt(n)];

		for(int i= 0; i<Integer.parseInt(n); i++){
			nums[i]  = Integer.parseInt(Snums[i]);
		}
		int key =0;
		int j=0;
		for(int i=1; i<nums.length; i++){
			key = nums[i];
			j = i-1;
			for(int k=0; k<nums.length; k++){
				buider.append(nums[k]);
				if(k != nums.length-1){
				buider.append(" ");
				}
			}
			System.out.println(buider.toString());
			buider.setLength(0);
			while (j>=0 && nums[j]>key) {
				nums[j+1] =nums[j];
				j--;
			}
			nums[j+1] =key;
		}
		for(int k=0; k<nums.length; k++){
			buider.append(nums[k]);
			if(k != nums.length-1){
			buider.append(" ");
			}
		}
		System.out.println(buider.toString());



	} main {

		StringBuilder buider = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String n = br.readLine();

		String[] Snums = br.readLine().split(" ");

		int[]  nums = new int[Integer.parseInt(n)];

		for(int i= 0; i<Integer.parseInt(n); i++){
			nums[i]  = Integer.parseInt(Snums[i]);
		}
		int key =0;
		int j=0;
		for(int i=1; i<nums.length; i++){
			key = nums[i];
			j = i-1;
			for(int k=0; k<nums.length; k++){
				buider.append(nums[k]);
				if(k != nums.length-1){
				buider.append(" ");
				}
			}
			System.out.println(buider.toString());
			buider.setLength(0);
			while (j>=0 && nums[j]>key) {
				nums[j+1] =nums[j];
				j--;
			}
			nums[j+1] =key;
		}
		for(int k=0; k<nums.length; k++){
			buider.append(nums[k]);
			if(k != nums.length-1){
			buider.append(" ");
			}
		}
		System.out.println(buider.toString());



	} StringBuilder buider = new StringBuilder(); buider new StringBuilder() BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String n = br.readLine(); n br.readLine() br.readLine br String[] Snums = br.readLine().split(" "); Snums br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[]  nums = new int[Integer.parseInt(n)]; nums new int[Integer.parseInt(n)] Integer.parseInt(n) Integer.parseInt Integer n for(int i= 0; i<Integer.parseInt(n); i++){
			nums[i]  = Integer.parseInt(Snums[i]);
		} int i= 0; int i= 0; i 0 i<Integer.parseInt(n) i Integer.parseInt(n) Integer.parseInt Integer n i++ i++ i {
			nums[i]  = Integer.parseInt(Snums[i]);
		} {
			nums[i]  = Integer.parseInt(Snums[i]);
		} nums[i]  = Integer.parseInt(Snums[i]) nums[i] nums i Integer.parseInt(Snums[i]) Integer.parseInt Integer Snums[i] Snums i int key =0; key 0 int j=0; j 0 for(int i=1; i<nums.length; i++){
			key = nums[i];
			j = i-1;
			for(int k=0; k<nums.length; k++){
				buider.append(nums[k]);
				if(k != nums.length-1){
				buider.append(" ");
				}
			}
			System.out.println(buider.toString());
			buider.setLength(0);
			while (j>=0 && nums[j]>key) {
				nums[j+1] =nums[j];
				j--;
			}
			nums[j+1] =key;
		} int i=1; int i=1; i 1 i<nums.length i nums.length nums nums.length i++ i++ i {
			key = nums[i];
			j = i-1;
			for(int k=0; k<nums.length; k++){
				buider.append(nums[k]);
				if(k != nums.length-1){
				buider.append(" ");
				}
			}
			System.out.println(buider.toString());
			buider.setLength(0);
			while (j>=0 && nums[j]>key) {
				nums[j+1] =nums[j];
				j--;
			}
			nums[j+1] =key;
		} {
			key = nums[i];
			j = i-1;
			for(int k=0; k<nums.length; k++){
				buider.append(nums[k]);
				if(k != nums.length-1){
				buider.append(" ");
				}
			}
			System.out.println(buider.toString());
			buider.setLength(0);
			while (j>=0 && nums[j]>key) {
				nums[j+1] =nums[j];
				j--;
			}
			nums[j+1] =key;
		} key = nums[i] key nums[i] nums i j = i-1 j i-1 i 1 for(int k=0; k<nums.length; k++){
				buider.append(nums[k]);
				if(k != nums.length-1){
				buider.append(" ");
				}
			} int k=0; int k=0; k 0 k<nums.length k nums.length nums nums.length k++ k++ k {
				buider.append(nums[k]);
				if(k != nums.length-1){
				buider.append(" ");
				}
			} {
				buider.append(nums[k]);
				if(k != nums.length-1){
				buider.append(" ");
				}
			} buider.append(nums[k]) buider.append buider nums[k] nums k if(k != nums.length-1){
				buider.append(" ");
				} k != nums.length-1 k nums.length-1 nums.length nums nums.length 1 {
				buider.append(" ");
				} buider.append(" ") buider.append buider " " System.out.println(buider.toString()) System.out.println System.out System System.out buider.toString() buider.toString buider buider.setLength(0) buider.setLength buider 0 while (j>=0 && nums[j]>key) {
				nums[j+1] =nums[j];
				j--;
			} j>=0 && nums[j]>key j>=0 j 0 nums[j]>key nums[j] nums j key {
				nums[j+1] =nums[j];
				j--;
			} nums[j+1] =nums[j] nums[j+1] nums j+1 j 1 nums[j] nums j j-- j nums[j+1] =key nums[j+1] nums j+1 j 1 key for(int k=0; k<nums.length; k++){
			buider.append(nums[k]);
			if(k != nums.length-1){
			buider.append(" ");
			}
		} int k=0; int k=0; k 0 k<nums.length k nums.length nums nums.length k++ k++ k {
			buider.append(nums[k]);
			if(k != nums.length-1){
			buider.append(" ");
			}
		} {
			buider.append(nums[k]);
			if(k != nums.length-1){
			buider.append(" ");
			}
		} buider.append(nums[k]) buider.append buider nums[k] nums k if(k != nums.length-1){
			buider.append(" ");
			} k != nums.length-1 k nums.length-1 nums.length nums nums.length 1 {
			buider.append(" ");
			} buider.append(" ") buider.append buider " " System.out.println(buider.toString()) System.out.println System.out System System.out buider.toString() buider.toString buider String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {

	public static void main(String[] args) throws IOException {

		StringBuilder buider = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String n = br.readLine();

		String[] Snums = br.readLine().split(" ");

		int[]  nums = new int[Integer.parseInt(n)];

		for(int i= 0; i<Integer.parseInt(n); i++){
			nums[i]  = Integer.parseInt(Snums[i]);
		}
		int key =0;
		int j=0;
		for(int i=1; i<nums.length; i++){
			key = nums[i];
			j = i-1;
			for(int k=0; k<nums.length; k++){
				buider.append(nums[k]);
				if(k != nums.length-1){
				buider.append(" ");
				}
			}
			System.out.println(buider.toString());
			buider.setLength(0);
			while (j>=0 && nums[j]>key) {
				nums[j+1] =nums[j];
				j--;
			}
			nums[j+1] =key;
		}
		for(int k=0; k<nums.length; k++){
			buider.append(nums[k]);
			if(k != nums.length-1){
			buider.append(" ");
			}
		}
		System.out.println(buider.toString());



	}

}