import java.io.File;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args){
        // write your code here
            Scanner scan = new Scanner(System.in);
            int index = scan.nextInt();
            int[] arr = new int[index];
            for(int i = 0; i<index;i++){
                arr[i] = scan.nextInt();
            }

            for(int i = 0; i<index;i++){
                int key = arr[i];
                int j = i-1;
                while(j>=0 && arr[j]>key){
                    arr[j+1] = arr[j];
                    j--;
                }
                arr[j+1] = key;
                for(int k = 0; k<index;k++){
                    System.out.print(arr[k]);
                    if(k!=index-1)System.out.print(" ");
                }
                System.out.print("\n");
            }
    }
} import java.io.File; File java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        // write your code here
            Scanner scan = new Scanner(System.in);
            int index = scan.nextInt();
            int[] arr = new int[index];
            for(int i = 0; i<index;i++){
                arr[i] = scan.nextInt();
            }

            for(int i = 0; i<index;i++){
                int key = arr[i];
                int j = i-1;
                while(j>=0 && arr[j]>key){
                    arr[j+1] = arr[j];
                    j--;
                }
                arr[j+1] = key;
                for(int k = 0; k<index;k++){
                    System.out.print(arr[k]);
                    if(k!=index-1)System.out.print(" ");
                }
                System.out.print("\n");
            }
    }
} Main public static void main(String[] args){
        // write your code here
            Scanner scan = new Scanner(System.in);
            int index = scan.nextInt();
            int[] arr = new int[index];
            for(int i = 0; i<index;i++){
                arr[i] = scan.nextInt();
            }

            for(int i = 0; i<index;i++){
                int key = arr[i];
                int j = i-1;
                while(j>=0 && arr[j]>key){
                    arr[j+1] = arr[j];
                    j--;
                }
                arr[j+1] = key;
                for(int k = 0; k<index;k++){
                    System.out.print(arr[k]);
                    if(k!=index-1)System.out.print(" ");
                }
                System.out.print("\n");
            }
    } main {
        // write your code here
            Scanner scan = new Scanner(System.in);
            int index = scan.nextInt();
            int[] arr = new int[index];
            for(int i = 0; i<index;i++){
                arr[i] = scan.nextInt();
            }

            for(int i = 0; i<index;i++){
                int key = arr[i];
                int j = i-1;
                while(j>=0 && arr[j]>key){
                    arr[j+1] = arr[j];
                    j--;
                }
                arr[j+1] = key;
                for(int k = 0; k<index;k++){
                    System.out.print(arr[k]);
                    if(k!=index-1)System.out.print(" ");
                }
                System.out.print("\n");
            }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int index = scan.nextInt(); index scan.nextInt() scan.nextInt scan int[] arr = new int[index]; arr new int[index] index for(int i = 0; i<index;i++){
                arr[i] = scan.nextInt();
            } int i = 0; int i = 0; i 0 i<index i index i++ i++ i {
                arr[i] = scan.nextInt();
            } {
                arr[i] = scan.nextInt();
            } arr[i] = scan.nextInt() arr[i] arr i scan.nextInt() scan.nextInt scan for(int i = 0; i<index;i++){
                int key = arr[i];
                int j = i-1;
                while(j>=0 && arr[j]>key){
                    arr[j+1] = arr[j];
                    j--;
                }
                arr[j+1] = key;
                for(int k = 0; k<index;k++){
                    System.out.print(arr[k]);
                    if(k!=index-1)System.out.print(" ");
                }
                System.out.print("\n");
            } int i = 0; int i = 0; i 0 i<index i index i++ i++ i {
                int key = arr[i];
                int j = i-1;
                while(j>=0 && arr[j]>key){
                    arr[j+1] = arr[j];
                    j--;
                }
                arr[j+1] = key;
                for(int k = 0; k<index;k++){
                    System.out.print(arr[k]);
                    if(k!=index-1)System.out.print(" ");
                }
                System.out.print("\n");
            } {
                int key = arr[i];
                int j = i-1;
                while(j>=0 && arr[j]>key){
                    arr[j+1] = arr[j];
                    j--;
                }
                arr[j+1] = key;
                for(int k = 0; k<index;k++){
                    System.out.print(arr[k]);
                    if(k!=index-1)System.out.print(" ");
                }
                System.out.print("\n");
            } int key = arr[i]; key arr[i] arr i int j = i-1; j i-1 i 1 while(j>=0 && arr[j]>key){
                    arr[j+1] = arr[j];
                    j--;
                } j>=0 && arr[j]>key j>=0 j 0 arr[j]>key arr[j] arr j key {
                    arr[j+1] = arr[j];
                    j--;
                } arr[j+1] = arr[j] arr[j+1] arr j+1 j 1 arr[j] arr j j-- j arr[j+1] = key arr[j+1] arr j+1 j 1 key for(int k = 0; k<index;k++){
                    System.out.print(arr[k]);
                    if(k!=index-1)System.out.print(" ");
                } int k = 0; int k = 0; k 0 k<index k index k++ k++ k {
                    System.out.print(arr[k]);
                    if(k!=index-1)System.out.print(" ");
                } {
                    System.out.print(arr[k]);
                    if(k!=index-1)System.out.print(" ");
                } System.out.print(arr[k]) System.out.print System.out System System.out arr[k] arr k if(k!=index-1)System.out.print(" "); k!=index-1 k index-1 index 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.print("\n") System.out.print System.out System System.out "\n" String[] args args public class Main {
    public static void main(String[] args){
        // write your code here
            Scanner scan = new Scanner(System.in);
            int index = scan.nextInt();
            int[] arr = new int[index];
            for(int i = 0; i<index;i++){
                arr[i] = scan.nextInt();
            }

            for(int i = 0; i<index;i++){
                int key = arr[i];
                int j = i-1;
                while(j>=0 && arr[j]>key){
                    arr[j+1] = arr[j];
                    j--;
                }
                arr[j+1] = key;
                for(int k = 0; k<index;k++){
                    System.out.print(arr[k]);
                    if(k!=index-1)System.out.print(" ");
                }
                System.out.print("\n");
            }
    }
} public class Main {
    public static void main(String[] args){
        // write your code here
            Scanner scan = new Scanner(System.in);
            int index = scan.nextInt();
            int[] arr = new int[index];
            for(int i = 0; i<index;i++){
                arr[i] = scan.nextInt();
            }

            for(int i = 0; i<index;i++){
                int key = arr[i];
                int j = i-1;
                while(j>=0 && arr[j]>key){
                    arr[j+1] = arr[j];
                    j--;
                }
                arr[j+1] = key;
                for(int k = 0; k<index;k++){
                    System.out.print(arr[k]);
                    if(k!=index-1)System.out.print(" ");
                }
                System.out.print("\n");
            }
    }
} Main
import java.io.File;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args){
        // write your code here
            Scanner scan = new Scanner(System.in);
            int index = scan.nextInt();
            int[] arr = new int[index];
            for(int i = 0; i<index;i++){
                arr[i] = scan.nextInt();
            }

            for(int i = 0; i<index;i++){
                int key = arr[i];
                int j = i-1;
                while(j>=0 && arr[j]>key){
                    arr[j+1] = arr[j];
                    j--;
                }
                arr[j+1] = key;
                for(int k = 0; k<index;k++){
                    System.out.print(arr[k]);
                    if(k!=index-1)System.out.print(" ");
                }
                System.out.print("\n");
            }
    }
}