import java.util.Scanner;

public class Main {
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt();
		int array[] = new int [size];
		for(int i=0; i<size; i++ ){
			array[i] = sc.nextInt();
		}
		
		
		for(int k=0; k<size; k++){
			
			if(k == size-1){
				System.out.println(array[k]);
			}else{
				System.out.print(array[k] + " ");
			}
		}
		//?????\?????????
		for(int i=1; i<size; i++){
			int v = array[i];
			int j = i-1;
			while(j >= 0 && array[j] > v){
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = v;
		//???????????§
			for(int k=0; k<size; k++){
				if(k == size-1){
					System.out.println(array[k]);
				}else{
					System.out.print(array[k] + " ");
				}
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt();
		int array[] = new int [size];
		for(int i=0; i<size; i++ ){
			array[i] = sc.nextInt();
		}
		
		
		for(int k=0; k<size; k++){
			
			if(k == size-1){
				System.out.println(array[k]);
			}else{
				System.out.print(array[k] + " ");
			}
		}
		//?????\?????????
		for(int i=1; i<size; i++){
			int v = array[i];
			int j = i-1;
			while(j >= 0 && array[j] > v){
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = v;
		//???????????§
			for(int k=0; k<size; k++){
				if(k == size-1){
					System.out.println(array[k]);
				}else{
					System.out.print(array[k] + " ");
				}
			}
		}
	}
} Main public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt();
		int array[] = new int [size];
		for(int i=0; i<size; i++ ){
			array[i] = sc.nextInt();
		}
		
		
		for(int k=0; k<size; k++){
			
			if(k == size-1){
				System.out.println(array[k]);
			}else{
				System.out.print(array[k] + " ");
			}
		}
		//?????\?????????
		for(int i=1; i<size; i++){
			int v = array[i];
			int j = i-1;
			while(j >= 0 && array[j] > v){
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = v;
		//???????????§
			for(int k=0; k<size; k++){
				if(k == size-1){
					System.out.println(array[k]);
				}else{
					System.out.print(array[k] + " ");
				}
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt();
		int array[] = new int [size];
		for(int i=0; i<size; i++ ){
			array[i] = sc.nextInt();
		}
		
		
		for(int k=0; k<size; k++){
			
			if(k == size-1){
				System.out.println(array[k]);
			}else{
				System.out.print(array[k] + " ");
			}
		}
		//?????\?????????
		for(int i=1; i<size; i++){
			int v = array[i];
			int j = i-1;
			while(j >= 0 && array[j] > v){
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = v;
		//???????????§
			for(int k=0; k<size; k++){
				if(k == size-1){
					System.out.println(array[k]);
				}else{
					System.out.print(array[k] + " ");
				}
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int size = sc.nextInt(); size sc.nextInt() sc.nextInt sc int array[] = new int [size]; array new int [size] size for(int i=0; i<size; i++ ){
			array[i] = sc.nextInt();
		} int i=0; int i=0; i 0 i<size i size i++ i++ i {
			array[i] = sc.nextInt();
		} {
			array[i] = sc.nextInt();
		} array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc for(int k=0; k<size; k++){
			
			if(k == size-1){
				System.out.println(array[k]);
			}else{
				System.out.print(array[k] + " ");
			}
		} int k=0; int k=0; k 0 k<size k size k++ k++ k {
			
			if(k == size-1){
				System.out.println(array[k]);
			}else{
				System.out.print(array[k] + " ");
			}
		} {
			
			if(k == size-1){
				System.out.println(array[k]);
			}else{
				System.out.print(array[k] + " ");
			}
		} if(k == size-1){
				System.out.println(array[k]);
			}else{
				System.out.print(array[k] + " ");
			} k == size-1 k size-1 size 1 {
				System.out.println(array[k]);
			} System.out.println(array[k]) System.out.println System.out System System.out array[k] array k {
				System.out.print(array[k] + " ");
			} System.out.print(array[k] + " ") System.out.print System.out System System.out array[k] + " " array[k] array k " " for(int i=1; i<size; i++){
			int v = array[i];
			int j = i-1;
			while(j >= 0 && array[j] > v){
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = v;
		//???????????§
			for(int k=0; k<size; k++){
				if(k == size-1){
					System.out.println(array[k]);
				}else{
					System.out.print(array[k] + " ");
				}
			}
		} int i=1; int i=1; i 1 i<size i size i++ i++ i {
			int v = array[i];
			int j = i-1;
			while(j >= 0 && array[j] > v){
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = v;
		//???????????§
			for(int k=0; k<size; k++){
				if(k == size-1){
					System.out.println(array[k]);
				}else{
					System.out.print(array[k] + " ");
				}
			}
		} {
			int v = array[i];
			int j = i-1;
			while(j >= 0 && array[j] > v){
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = v;
		//???????????§
			for(int k=0; k<size; k++){
				if(k == size-1){
					System.out.println(array[k]);
				}else{
					System.out.print(array[k] + " ");
				}
			}
		} int v = array[i]; v array[i] array i int j = i-1; j i-1 i 1 while(j >= 0 && array[j] > v){
				array[j+1] = array[j];
				j--;
			} j >= 0 && array[j] > v j >= 0 j 0 array[j] > v array[j] array j v {
				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] = v array[j+1] array j+1 j 1 v for(int k=0; k<size; k++){
				if(k == size-1){
					System.out.println(array[k]);
				}else{
					System.out.print(array[k] + " ");
				}
			} int k=0; int k=0; k 0 k<size k size k++ k++ k {
				if(k == size-1){
					System.out.println(array[k]);
				}else{
					System.out.print(array[k] + " ");
				}
			} {
				if(k == size-1){
					System.out.println(array[k]);
				}else{
					System.out.print(array[k] + " ");
				}
			} if(k == size-1){
					System.out.println(array[k]);
				}else{
					System.out.print(array[k] + " ");
				} k == size-1 k size-1 size 1 {
					System.out.println(array[k]);
				} System.out.println(array[k]) System.out.println System.out System System.out array[k] array k {
					System.out.print(array[k] + " ");
				} System.out.print(array[k] + " ") System.out.print System.out System System.out array[k] + " " array[k] array k " " String [] args args public class Main {
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt();
		int array[] = new int [size];
		for(int i=0; i<size; i++ ){
			array[i] = sc.nextInt();
		}
		
		
		for(int k=0; k<size; k++){
			
			if(k == size-1){
				System.out.println(array[k]);
			}else{
				System.out.print(array[k] + " ");
			}
		}
		//?????\?????????
		for(int i=1; i<size; i++){
			int v = array[i];
			int j = i-1;
			while(j >= 0 && array[j] > v){
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = v;
		//???????????§
			for(int k=0; k<size; k++){
				if(k == size-1){
					System.out.println(array[k]);
				}else{
					System.out.print(array[k] + " ");
				}
			}
		}
	}
} public class Main {
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt();
		int array[] = new int [size];
		for(int i=0; i<size; i++ ){
			array[i] = sc.nextInt();
		}
		
		
		for(int k=0; k<size; k++){
			
			if(k == size-1){
				System.out.println(array[k]);
			}else{
				System.out.print(array[k] + " ");
			}
		}
		//?????\?????????
		for(int i=1; i<size; i++){
			int v = array[i];
			int j = i-1;
			while(j >= 0 && array[j] > v){
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = v;
		//???????????§
			for(int k=0; k<size; k++){
				if(k == size-1){
					System.out.println(array[k]);
				}else{
					System.out.print(array[k] + " ");
				}
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt();
		int array[] = new int [size];
		for(int i=0; i<size; i++ ){
			array[i] = sc.nextInt();
		}
		
		
		for(int k=0; k<size; k++){
			
			if(k == size-1){
				System.out.println(array[k]);
			}else{
				System.out.print(array[k] + " ");
			}
		}
		//?????\?????????
		for(int i=1; i<size; i++){
			int v = array[i];
			int j = i-1;
			while(j >= 0 && array[j] > v){
				array[j+1] = array[j];
				j--;
			}
			array[j+1] = v;
		//???????????§
			for(int k=0; k<size; k++){
				if(k == size-1){
					System.out.println(array[k]);
				}else{
					System.out.print(array[k] + " ");
				}
			}
		}
	}
}