import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int i,j,k,v;
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int array[] = new int[n];

		for(i=0;i<n;i++)array[i] = in.nextInt();

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

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		int i,j,k,v;
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int array[] = new int[n];

		for(i=0;i<n;i++)array[i] = in.nextInt();

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

} Main public static void main(String[] args) {
		int i,j,k,v;
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int array[] = new int[n];

		for(i=0;i<n;i++)array[i] = in.nextInt();

	for(i=0;i<n;i++){
		v = array[i];
		j = i-1;
		while(j>=0 && array[j]>v){
			array[j+1] = array[j];
			j--;
		array[j+1] = v;
		}
	    for(k = 0;k<n-1;k++)System.out.print(array[k]+" ");
	    if(i<(n-1))System.out.println(array[k]);
	    else System.out.println(array[k]);
	}
	} main {
		int i,j,k,v;
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int array[] = new int[n];

		for(i=0;i<n;i++)array[i] = in.nextInt();

	for(i=0;i<n;i++){
		v = array[i];
		j = i-1;
		while(j>=0 && array[j]>v){
			array[j+1] = array[j];
			j--;
		array[j+1] = v;
		}
	    for(k = 0;k<n-1;k++)System.out.print(array[k]+" ");
	    if(i<(n-1))System.out.println(array[k]);
	    else System.out.println(array[k]);
	}
	} int i i j j k k v; v Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int array[] = new int[n]; array new int[n] n for(i=0;i<n;i++)array[i] = in.nextInt(); i=0; i=0 i 0 i<n i n i++ i++ i array[i] = in.nextInt(); array[i] = in.nextInt() array[i] array i in.nextInt() in.nextInt in for(i=0;i<n;i++){
		v = array[i];
		j = i-1;
		while(j>=0 && array[j]>v){
			array[j+1] = array[j];
			j--;
		array[j+1] = v;
		}
	    for(k = 0;k<n-1;k++)System.out.print(array[k]+" ");
	    if(i<(n-1))System.out.println(array[k]);
	    else System.out.println(array[k]);
	} i=0; i=0 i 0 i<n i n i++ i++ i {
		v = array[i];
		j = i-1;
		while(j>=0 && array[j]>v){
			array[j+1] = array[j];
			j--;
		array[j+1] = v;
		}
	    for(k = 0;k<n-1;k++)System.out.print(array[k]+" ");
	    if(i<(n-1))System.out.println(array[k]);
	    else System.out.println(array[k]);
	} {
		v = array[i];
		j = i-1;
		while(j>=0 && array[j]>v){
			array[j+1] = array[j];
			j--;
		array[j+1] = v;
		}
	    for(k = 0;k<n-1;k++)System.out.print(array[k]+" ");
	    if(i<(n-1))System.out.println(array[k]);
	    else System.out.println(array[k]);
	} v = array[i] v array[i] array i j = i-1 j i-1 i 1 while(j>=0 && array[j]>v){
			array[j+1] = array[j];
			j--;
		array[j+1] = v;
		} 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] = v;
		} 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(k = 0;k<n-1;k++)System.out.print(array[k]+" "); k = 0; k = 0 k 0 k<n-1 k n-1 n 1 k++ k++ 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 " " if(i<(n-1))System.out.println(array[k]);
	    else System.out.println(array[k]); i<(n-1) i (n-1) n 1 System.out.println(array[k]) System.out.println System.out System System.out array[k] array k System.out.println(array[k]) System.out.println System.out System System.out array[k] array k String[] args args public class Main {

	public static void main(String[] args) {
		int i,j,k,v;
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int array[] = new int[n];

		for(i=0;i<n;i++)array[i] = in.nextInt();

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

} public class Main {

	public static void main(String[] args) {
		int i,j,k,v;
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int array[] = new int[n];

		for(i=0;i<n;i++)array[i] = in.nextInt();

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

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int i,j,k,v;
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int array[] = new int[n];

		for(i=0;i<n;i++)array[i] = in.nextInt();

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

}