import java.util.*;

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

	int n;
	int i, j;
	int v;
	Scanner scan = new Scanner(System.in);
	String str = new String();

	n =  scan.nextInt();
	int A[] = new int[n];

	for(i=0; i<n; i++)
		A[i] = scan.nextInt();

	for(i=0; i<n ; i++){
		v = A[i];
		j = i-1;
		while(j >= 0 && A[j] > v){
			A[j+1] = A[j];
			j--;
		}
		A[j+1] = v;
		str = Arrays.toString(A);
		str = str.replaceAll("\\[|\\]|,","");
		System.out.println(str);
	}

	return;

  }

} import java.util.*; util.* java class Main{
  public static void main(String args[]){

	int n;
	int i, j;
	int v;
	Scanner scan = new Scanner(System.in);
	String str = new String();

	n =  scan.nextInt();
	int A[] = new int[n];

	for(i=0; i<n; i++)
		A[i] = scan.nextInt();

	for(i=0; i<n ; i++){
		v = A[i];
		j = i-1;
		while(j >= 0 && A[j] > v){
			A[j+1] = A[j];
			j--;
		}
		A[j+1] = v;
		str = Arrays.toString(A);
		str = str.replaceAll("\\[|\\]|,","");
		System.out.println(str);
	}

	return;

  }

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

	int n;
	int i, j;
	int v;
	Scanner scan = new Scanner(System.in);
	String str = new String();

	n =  scan.nextInt();
	int A[] = new int[n];

	for(i=0; i<n; i++)
		A[i] = scan.nextInt();

	for(i=0; i<n ; i++){
		v = A[i];
		j = i-1;
		while(j >= 0 && A[j] > v){
			A[j+1] = A[j];
			j--;
		}
		A[j+1] = v;
		str = Arrays.toString(A);
		str = str.replaceAll("\\[|\\]|,","");
		System.out.println(str);
	}

	return;

  } main {

	int n;
	int i, j;
	int v;
	Scanner scan = new Scanner(System.in);
	String str = new String();

	n =  scan.nextInt();
	int A[] = new int[n];

	for(i=0; i<n; i++)
		A[i] = scan.nextInt();

	for(i=0; i<n ; i++){
		v = A[i];
		j = i-1;
		while(j >= 0 && A[j] > v){
			A[j+1] = A[j];
			j--;
		}
		A[j+1] = v;
		str = Arrays.toString(A);
		str = str.replaceAll("\\[|\\]|,","");
		System.out.println(str);
	}

	return;

  } int n; n int i i j; j int v; v Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String str = new String(); str new String() n =  scan.nextInt() n scan.nextInt() scan.nextInt scan int A[] = new int[n]; A new int[n] n for(i=0; i<n; i++)
		A[i] = scan.nextInt(); i=0; i=0 i 0 i<n i n i++ i++ i A[i] = scan.nextInt(); A[i] = scan.nextInt() A[i] A i scan.nextInt() scan.nextInt scan for(i=0; i<n ; i++){
		v = A[i];
		j = i-1;
		while(j >= 0 && A[j] > v){
			A[j+1] = A[j];
			j--;
		}
		A[j+1] = v;
		str = Arrays.toString(A);
		str = str.replaceAll("\\[|\\]|,","");
		System.out.println(str);
	} i=0; i=0 i 0 i<n i n i++ i++ i {
		v = A[i];
		j = i-1;
		while(j >= 0 && A[j] > v){
			A[j+1] = A[j];
			j--;
		}
		A[j+1] = v;
		str = Arrays.toString(A);
		str = str.replaceAll("\\[|\\]|,","");
		System.out.println(str);
	} {
		v = A[i];
		j = i-1;
		while(j >= 0 && A[j] > v){
			A[j+1] = A[j];
			j--;
		}
		A[j+1] = v;
		str = Arrays.toString(A);
		str = str.replaceAll("\\[|\\]|,","");
		System.out.println(str);
	} v = A[i] v A[i] A i j = i-1 j i-1 i 1 while(j >= 0 && A[j] > v){
			A[j+1] = A[j];
			j--;
		} j >= 0 && A[j] > v j >= 0 j 0 A[j] > v A[j] A j v {
			A[j+1] = A[j];
			j--;
		} A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j j-- j A[j+1] = v A[j+1] A j+1 j 1 v str = Arrays.toString(A) str Arrays.toString(A) Arrays.toString Arrays A str = str.replaceAll("\\[|\\]|,","") str str.replaceAll("\\[|\\]|,","") str.replaceAll str "\\[|\\]|," "" System.out.println(str) System.out.println System.out System System.out str return; String args[] args
import java.util.*;

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

	int n;
	int i, j;
	int v;
	Scanner scan = new Scanner(System.in);
	String str = new String();

	n =  scan.nextInt();
	int A[] = new int[n];

	for(i=0; i<n; i++)
		A[i] = scan.nextInt();

	for(i=0; i<n ; i++){
		v = A[i];
		j = i-1;
		while(j >= 0 && A[j] > v){
			A[j+1] = A[j];
			j--;
		}
		A[j+1] = v;
		str = Arrays.toString(A);
		str = str.replaceAll("\\[|\\]|,","");
		System.out.println(str);
	}

	return;

  }

}