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

public class Main {
	public static void main(String[] args)throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int n = Integer.parseInt(line);
        String line2 = br.readLine();
        String[] str = line2.split(" ");
        int[] a = new int[n];
        for(int i=0;i<n;i++)a[i]=Integer.parseInt(str[i]);
        for(int i=0;i<n;i++){
        	int tmp = a[i];
        	int j = i-1;
        	while(j>=0&&a[j]>tmp){
        		a[j+1]=a[j];
        		j--;
        	}
        	a[j+1]=tmp;
        	for(int k=0;k<n;k++){
        		if(k!=n-1)System.out.print(a[k]+" ");
        		else System.out.println(a[k]);
        	}
        }
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args)throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int n = Integer.parseInt(line);
        String line2 = br.readLine();
        String[] str = line2.split(" ");
        int[] a = new int[n];
        for(int i=0;i<n;i++)a[i]=Integer.parseInt(str[i]);
        for(int i=0;i<n;i++){
        	int tmp = a[i];
        	int j = i-1;
        	while(j>=0&&a[j]>tmp){
        		a[j+1]=a[j];
        		j--;
        	}
        	a[j+1]=tmp;
        	for(int k=0;k<n;k++){
        		if(k!=n-1)System.out.print(a[k]+" ");
        		else System.out.println(a[k]);
        	}
        }
	}
} Main public static void main(String[] args)throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int n = Integer.parseInt(line);
        String line2 = br.readLine();
        String[] str = line2.split(" ");
        int[] a = new int[n];
        for(int i=0;i<n;i++)a[i]=Integer.parseInt(str[i]);
        for(int i=0;i<n;i++){
        	int tmp = a[i];
        	int j = i-1;
        	while(j>=0&&a[j]>tmp){
        		a[j+1]=a[j];
        		j--;
        	}
        	a[j+1]=tmp;
        	for(int k=0;k<n;k++){
        		if(k!=n-1)System.out.print(a[k]+" ");
        		else System.out.println(a[k]);
        	}
        }
	} main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int n = Integer.parseInt(line);
        String line2 = br.readLine();
        String[] str = line2.split(" ");
        int[] a = new int[n];
        for(int i=0;i<n;i++)a[i]=Integer.parseInt(str[i]);
        for(int i=0;i<n;i++){
        	int tmp = a[i];
        	int j = i-1;
        	while(j>=0&&a[j]>tmp){
        		a[j+1]=a[j];
        		j--;
        	}
        	a[j+1]=tmp;
        	for(int k=0;k<n;k++){
        		if(k!=n-1)System.out.print(a[k]+" ");
        		else System.out.println(a[k]);
        	}
        }
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line = br.readLine(); line br.readLine() br.readLine br int n = Integer.parseInt(line); n Integer.parseInt(line) Integer.parseInt Integer line String line2 = br.readLine(); line2 br.readLine() br.readLine br String[] str = line2.split(" "); str line2.split(" ") line2.split line2 " " int[] a = new int[n]; a new int[n] n for(int i=0;i<n;i++)a[i]=Integer.parseInt(str[i]); int i=0; int i=0; i 0 i<n i n i++ i++ i a[i]=Integer.parseInt(str[i]); a[i]=Integer.parseInt(str[i]) a[i] a i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i for(int i=0;i<n;i++){
        	int tmp = a[i];
        	int j = i-1;
        	while(j>=0&&a[j]>tmp){
        		a[j+1]=a[j];
        		j--;
        	}
        	a[j+1]=tmp;
        	for(int k=0;k<n;k++){
        		if(k!=n-1)System.out.print(a[k]+" ");
        		else System.out.println(a[k]);
        	}
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        	int tmp = a[i];
        	int j = i-1;
        	while(j>=0&&a[j]>tmp){
        		a[j+1]=a[j];
        		j--;
        	}
        	a[j+1]=tmp;
        	for(int k=0;k<n;k++){
        		if(k!=n-1)System.out.print(a[k]+" ");
        		else System.out.println(a[k]);
        	}
        } {
        	int tmp = a[i];
        	int j = i-1;
        	while(j>=0&&a[j]>tmp){
        		a[j+1]=a[j];
        		j--;
        	}
        	a[j+1]=tmp;
        	for(int k=0;k<n;k++){
        		if(k!=n-1)System.out.print(a[k]+" ");
        		else System.out.println(a[k]);
        	}
        } int tmp = a[i]; tmp a[i] a i int j = i-1; j i-1 i 1 while(j>=0&&a[j]>tmp){
        		a[j+1]=a[j];
        		j--;
        	} j>=0&&a[j]>tmp j>=0 j 0 a[j]>tmp a[j] a j tmp {
        		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]=tmp a[j+1] a j+1 j 1 tmp for(int k=0;k<n;k++){
        		if(k!=n-1)System.out.print(a[k]+" ");
        		else System.out.println(a[k]);
        	} int k=0; int k=0; k 0 k<n k n k++ k++ k {
        		if(k!=n-1)System.out.print(a[k]+" ");
        		else System.out.println(a[k]);
        	} {
        		if(k!=n-1)System.out.print(a[k]+" ");
        		else System.out.println(a[k]);
        	} if(k!=n-1)System.out.print(a[k]+" ");
        		else System.out.println(a[k]); k!=n-1 k n-1 n 1 System.out.print(a[k]+" ") System.out.print System.out System System.out a[k]+" " a[k] a k " " System.out.println(a[k]) System.out.println System.out System System.out a[k] a k String[] args args public class Main {
	public static void main(String[] args)throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int n = Integer.parseInt(line);
        String line2 = br.readLine();
        String[] str = line2.split(" ");
        int[] a = new int[n];
        for(int i=0;i<n;i++)a[i]=Integer.parseInt(str[i]);
        for(int i=0;i<n;i++){
        	int tmp = a[i];
        	int j = i-1;
        	while(j>=0&&a[j]>tmp){
        		a[j+1]=a[j];
        		j--;
        	}
        	a[j+1]=tmp;
        	for(int k=0;k<n;k++){
        		if(k!=n-1)System.out.print(a[k]+" ");
        		else System.out.println(a[k]);
        	}
        }
	}
} public class Main {
	public static void main(String[] args)throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int n = Integer.parseInt(line);
        String line2 = br.readLine();
        String[] str = line2.split(" ");
        int[] a = new int[n];
        for(int i=0;i<n;i++)a[i]=Integer.parseInt(str[i]);
        for(int i=0;i<n;i++){
        	int tmp = a[i];
        	int j = i-1;
        	while(j>=0&&a[j]>tmp){
        		a[j+1]=a[j];
        		j--;
        	}
        	a[j+1]=tmp;
        	for(int k=0;k<n;k++){
        		if(k!=n-1)System.out.print(a[k]+" ");
        		else System.out.println(a[k]);
        	}
        }
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args)throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int n = Integer.parseInt(line);
        String line2 = br.readLine();
        String[] str = line2.split(" ");
        int[] a = new int[n];
        for(int i=0;i<n;i++)a[i]=Integer.parseInt(str[i]);
        for(int i=0;i<n;i++){
        	int tmp = a[i];
        	int j = i-1;
        	while(j>=0&&a[j]>tmp){
        		a[j+1]=a[j];
        		j--;
        	}
        	a[j+1]=tmp;
        	for(int k=0;k<n;k++){
        		if(k!=n-1)System.out.print(a[k]+" ");
        		else System.out.println(a[k]);
        	}
        }
	}
}