import java.io.IOException;
import java.util.Scanner;
class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
//		System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int nagasa = scan.nextInt();
		int[] num = new int[nagasa];
		for(int i=0;i<nagasa;i++){
			num[i] = scan.nextInt();
		}
		for(int i=0;i<nagasa;i++){
			System.out.print(num[i]);
			if(i == nagasa-1){
				System.out.println("");
			}
			else{
				System.out.print(" ");
			}
		}
		for (int i=1;i <= nagasa-1;i++){
			int v = num[i];
			int j = i - 1;
			while(j >= 0 && num[j] > v){
				num[j+1] = num[j];
				j -= 1;
			}
			num[j+1] =v;
			for(int ii=0;ii<nagasa;ii++){
				System.out.print(num[ii]);
				if(ii == nagasa-1){
					System.out.println("");
				}
				else{
					System.out.print(" ");
				}
			}
		}
	}
} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
//		System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int nagasa = scan.nextInt();
		int[] num = new int[nagasa];
		for(int i=0;i<nagasa;i++){
			num[i] = scan.nextInt();
		}
		for(int i=0;i<nagasa;i++){
			System.out.print(num[i]);
			if(i == nagasa-1){
				System.out.println("");
			}
			else{
				System.out.print(" ");
			}
		}
		for (int i=1;i <= nagasa-1;i++){
			int v = num[i];
			int j = i - 1;
			while(j >= 0 && num[j] > v){
				num[j+1] = num[j];
				j -= 1;
			}
			num[j+1] =v;
			for(int ii=0;ii<nagasa;ii++){
				System.out.print(num[ii]);
				if(ii == nagasa-1){
					System.out.println("");
				}
				else{
					System.out.print(" ");
				}
			}
		}
	}
} Main public static void main(String[] args)throws NumberFormatException, IOException{
//		System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int nagasa = scan.nextInt();
		int[] num = new int[nagasa];
		for(int i=0;i<nagasa;i++){
			num[i] = scan.nextInt();
		}
		for(int i=0;i<nagasa;i++){
			System.out.print(num[i]);
			if(i == nagasa-1){
				System.out.println("");
			}
			else{
				System.out.print(" ");
			}
		}
		for (int i=1;i <= nagasa-1;i++){
			int v = num[i];
			int j = i - 1;
			while(j >= 0 && num[j] > v){
				num[j+1] = num[j];
				j -= 1;
			}
			num[j+1] =v;
			for(int ii=0;ii<nagasa;ii++){
				System.out.print(num[ii]);
				if(ii == nagasa-1){
					System.out.println("");
				}
				else{
					System.out.print(" ");
				}
			}
		}
	} main {
//		System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int nagasa = scan.nextInt();
		int[] num = new int[nagasa];
		for(int i=0;i<nagasa;i++){
			num[i] = scan.nextInt();
		}
		for(int i=0;i<nagasa;i++){
			System.out.print(num[i]);
			if(i == nagasa-1){
				System.out.println("");
			}
			else{
				System.out.print(" ");
			}
		}
		for (int i=1;i <= nagasa-1;i++){
			int v = num[i];
			int j = i - 1;
			while(j >= 0 && num[j] > v){
				num[j+1] = num[j];
				j -= 1;
			}
			num[j+1] =v;
			for(int ii=0;ii<nagasa;ii++){
				System.out.print(num[ii]);
				if(ii == nagasa-1){
					System.out.println("");
				}
				else{
					System.out.print(" ");
				}
			}
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int nagasa = scan.nextInt(); nagasa scan.nextInt() scan.nextInt scan int[] num = new int[nagasa]; num new int[nagasa] nagasa for(int i=0;i<nagasa;i++){
			num[i] = scan.nextInt();
		} int i=0; int i=0; i 0 i<nagasa i nagasa i++ i++ i {
			num[i] = scan.nextInt();
		} {
			num[i] = scan.nextInt();
		} num[i] = scan.nextInt() num[i] num i scan.nextInt() scan.nextInt scan for(int i=0;i<nagasa;i++){
			System.out.print(num[i]);
			if(i == nagasa-1){
				System.out.println("");
			}
			else{
				System.out.print(" ");
			}
		} int i=0; int i=0; i 0 i<nagasa i nagasa i++ i++ i {
			System.out.print(num[i]);
			if(i == nagasa-1){
				System.out.println("");
			}
			else{
				System.out.print(" ");
			}
		} {
			System.out.print(num[i]);
			if(i == nagasa-1){
				System.out.println("");
			}
			else{
				System.out.print(" ");
			}
		} System.out.print(num[i]) System.out.print System.out System System.out num[i] num i if(i == nagasa-1){
				System.out.println("");
			}
			else{
				System.out.print(" ");
			} i == nagasa-1 i nagasa-1 nagasa 1 {
				System.out.println("");
			} System.out.println("") System.out.println System.out System System.out "" {
				System.out.print(" ");
			} System.out.print(" ") System.out.print System.out System System.out " " for (int i=1;i <= nagasa-1;i++){
			int v = num[i];
			int j = i - 1;
			while(j >= 0 && num[j] > v){
				num[j+1] = num[j];
				j -= 1;
			}
			num[j+1] =v;
			for(int ii=0;ii<nagasa;ii++){
				System.out.print(num[ii]);
				if(ii == nagasa-1){
					System.out.println("");
				}
				else{
					System.out.print(" ");
				}
			}
		} int i=1; int i=1; i 1 i <= nagasa-1 i nagasa-1 nagasa 1 i++ i++ i {
			int v = num[i];
			int j = i - 1;
			while(j >= 0 && num[j] > v){
				num[j+1] = num[j];
				j -= 1;
			}
			num[j+1] =v;
			for(int ii=0;ii<nagasa;ii++){
				System.out.print(num[ii]);
				if(ii == nagasa-1){
					System.out.println("");
				}
				else{
					System.out.print(" ");
				}
			}
		} {
			int v = num[i];
			int j = i - 1;
			while(j >= 0 && num[j] > v){
				num[j+1] = num[j];
				j -= 1;
			}
			num[j+1] =v;
			for(int ii=0;ii<nagasa;ii++){
				System.out.print(num[ii]);
				if(ii == nagasa-1){
					System.out.println("");
				}
				else{
					System.out.print(" ");
				}
			}
		} int v = num[i]; v num[i] num i int j = i - 1; j i - 1 i 1 while(j >= 0 && num[j] > v){
				num[j+1] = num[j];
				j -= 1;
			} j >= 0 && num[j] > v j >= 0 j 0 num[j] > v num[j] num j v {
				num[j+1] = num[j];
				j -= 1;
			} num[j+1] = num[j] num[j+1] num j+1 j 1 num[j] num j j -= 1 j 1 num[j+1] =v num[j+1] num j+1 j 1 v for(int ii=0;ii<nagasa;ii++){
				System.out.print(num[ii]);
				if(ii == nagasa-1){
					System.out.println("");
				}
				else{
					System.out.print(" ");
				}
			} int ii=0; int ii=0; ii 0 ii<nagasa ii nagasa ii++ ii++ ii {
				System.out.print(num[ii]);
				if(ii == nagasa-1){
					System.out.println("");
				}
				else{
					System.out.print(" ");
				}
			} {
				System.out.print(num[ii]);
				if(ii == nagasa-1){
					System.out.println("");
				}
				else{
					System.out.print(" ");
				}
			} System.out.print(num[ii]) System.out.print System.out System System.out num[ii] num ii if(ii == nagasa-1){
					System.out.println("");
				}
				else{
					System.out.print(" ");
				} ii == nagasa-1 ii nagasa-1 nagasa 1 {
					System.out.println("");
				} System.out.println("") System.out.println System.out System System.out "" {
					System.out.print(" ");
				} System.out.print(" ") System.out.print System.out System System.out " " String[] args args
import java.io.IOException;
import java.util.Scanner;
class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
//		System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int nagasa = scan.nextInt();
		int[] num = new int[nagasa];
		for(int i=0;i<nagasa;i++){
			num[i] = scan.nextInt();
		}
		for(int i=0;i<nagasa;i++){
			System.out.print(num[i]);
			if(i == nagasa-1){
				System.out.println("");
			}
			else{
				System.out.print(" ");
			}
		}
		for (int i=1;i <= nagasa-1;i++){
			int v = num[i];
			int j = i - 1;
			while(j >= 0 && num[j] > v){
				num[j+1] = num[j];
				j -= 1;
			}
			num[j+1] =v;
			for(int ii=0;ii<nagasa;ii++){
				System.out.print(num[ii]);
				if(ii == nagasa-1){
					System.out.println("");
				}
				else{
					System.out.print(" ");
				}
			}
		}
	}
}