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

public class Main{

	public static void main(String[] args){

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int num, key;
		String str;
		String[] str_array;
		try{
		num=Integer.parseInt(reader.readLine());
		str=reader.readLine();
		str_array=str.split(" ");

		int[] array=new int[num];
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(str_array[i]);
		}

		for(int i=0;i<num;i++){
			key=array[i];
			int j=i-1;
			while(j>=0&&array[j]>key){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=key;

			for(int k=0;k<num;k++){
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			}
			System.out.println();
		}


		}catch(IOException e){
			//????????????
		}


	}

} 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){

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int num, key;
		String str;
		String[] str_array;
		try{
		num=Integer.parseInt(reader.readLine());
		str=reader.readLine();
		str_array=str.split(" ");

		int[] array=new int[num];
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(str_array[i]);
		}

		for(int i=0;i<num;i++){
			key=array[i];
			int j=i-1;
			while(j>=0&&array[j]>key){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=key;

			for(int k=0;k<num;k++){
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			}
			System.out.println();
		}


		}catch(IOException e){
			//????????????
		}


	}

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

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int num, key;
		String str;
		String[] str_array;
		try{
		num=Integer.parseInt(reader.readLine());
		str=reader.readLine();
		str_array=str.split(" ");

		int[] array=new int[num];
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(str_array[i]);
		}

		for(int i=0;i<num;i++){
			key=array[i];
			int j=i-1;
			while(j>=0&&array[j]>key){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=key;

			for(int k=0;k<num;k++){
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			}
			System.out.println();
		}


		}catch(IOException e){
			//????????????
		}


	} main {

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int num, key;
		String str;
		String[] str_array;
		try{
		num=Integer.parseInt(reader.readLine());
		str=reader.readLine();
		str_array=str.split(" ");

		int[] array=new int[num];
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(str_array[i]);
		}

		for(int i=0;i<num;i++){
			key=array[i];
			int j=i-1;
			while(j>=0&&array[j]>key){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=key;

			for(int k=0;k<num;k++){
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			}
			System.out.println();
		}


		}catch(IOException e){
			//????????????
		}


	} BufferedReader reader=new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) int num num key; key String str; str String[] str_array; str_array try{
		num=Integer.parseInt(reader.readLine());
		str=reader.readLine();
		str_array=str.split(" ");

		int[] array=new int[num];
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(str_array[i]);
		}

		for(int i=0;i<num;i++){
			key=array[i];
			int j=i-1;
			while(j>=0&&array[j]>key){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=key;

			for(int k=0;k<num;k++){
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			}
			System.out.println();
		}


		}catch(IOException e){
			//????????????
		} catch(IOException e){
			//????????????
		} IOException e {
			//????????????
		} {
		num=Integer.parseInt(reader.readLine());
		str=reader.readLine();
		str_array=str.split(" ");

		int[] array=new int[num];
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(str_array[i]);
		}

		for(int i=0;i<num;i++){
			key=array[i];
			int j=i-1;
			while(j>=0&&array[j]>key){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=key;

			for(int k=0;k<num;k++){
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			}
			System.out.println();
		}


		} num=Integer.parseInt(reader.readLine()) num Integer.parseInt(reader.readLine()) Integer.parseInt Integer reader.readLine() reader.readLine reader str=reader.readLine() str reader.readLine() reader.readLine reader str_array=str.split(" ") str_array str.split(" ") str.split str " " int[] array=new int[num]; array new int[num] num for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(str_array[i]);
		} int i=0; int i=0; i 0 i<num i num i++ i++ i {
			array[i]=Integer.parseInt(str_array[i]);
		} {
			array[i]=Integer.parseInt(str_array[i]);
		} array[i]=Integer.parseInt(str_array[i]) array[i] array i Integer.parseInt(str_array[i]) Integer.parseInt Integer str_array[i] str_array i for(int i=0;i<num;i++){
			key=array[i];
			int j=i-1;
			while(j>=0&&array[j]>key){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=key;

			for(int k=0;k<num;k++){
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			}
			System.out.println();
		} int i=0; int i=0; i 0 i<num i num i++ i++ i {
			key=array[i];
			int j=i-1;
			while(j>=0&&array[j]>key){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=key;

			for(int k=0;k<num;k++){
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			}
			System.out.println();
		} {
			key=array[i];
			int j=i-1;
			while(j>=0&&array[j]>key){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=key;

			for(int k=0;k<num;k++){
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			}
			System.out.println();
		} key=array[i] key array[i] array i int j=i-1; j i-1 i 1 while(j>=0&&array[j]>key){
				array[j+1]=array[j];
				j--;
			} j>=0&&array[j]>key j>=0 j 0 array[j]>key array[j] array j key {
				array[j+1]=array[j];
				j--;
			} array[j+1]=array[j] array[j+1] array j+1 j 1 array[j] array j j-- j array[j+1]=key array[j+1] array j+1 j 1 key for(int k=0;k<num;k++){
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			} int k=0; int k=0; k 0 k<num k num k++ k++ k {
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			} {
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			} System.out.print(array[k]) System.out.print System.out System System.out array[k] array k if(k!=num-1)System.out.print(" "); k!=num-1 k num-1 num 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out String[] args args public class Main{

	public static void main(String[] args){

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int num, key;
		String str;
		String[] str_array;
		try{
		num=Integer.parseInt(reader.readLine());
		str=reader.readLine();
		str_array=str.split(" ");

		int[] array=new int[num];
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(str_array[i]);
		}

		for(int i=0;i<num;i++){
			key=array[i];
			int j=i-1;
			while(j>=0&&array[j]>key){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=key;

			for(int k=0;k<num;k++){
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			}
			System.out.println();
		}


		}catch(IOException e){
			//????????????
		}


	}

} public class Main{

	public static void main(String[] args){

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int num, key;
		String str;
		String[] str_array;
		try{
		num=Integer.parseInt(reader.readLine());
		str=reader.readLine();
		str_array=str.split(" ");

		int[] array=new int[num];
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(str_array[i]);
		}

		for(int i=0;i<num;i++){
			key=array[i];
			int j=i-1;
			while(j>=0&&array[j]>key){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=key;

			for(int k=0;k<num;k++){
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			}
			System.out.println();
		}


		}catch(IOException e){
			//????????????
		}


	}

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

public class Main{

	public static void main(String[] args){

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int num, key;
		String str;
		String[] str_array;
		try{
		num=Integer.parseInt(reader.readLine());
		str=reader.readLine();
		str_array=str.split(" ");

		int[] array=new int[num];
		for(int i=0;i<num;i++){
			array[i]=Integer.parseInt(str_array[i]);
		}

		for(int i=0;i<num;i++){
			key=array[i];
			int j=i-1;
			while(j>=0&&array[j]>key){
				array[j+1]=array[j];
				j--;
			}
			array[j+1]=key;

			for(int k=0;k<num;k++){
				System.out.print(array[k]);
				if(k!=num-1)System.out.print(" ");
			}
			System.out.println();
		}


		}catch(IOException e){
			//????????????
		}


	}

}