import java.util.Scanner;
 
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int [n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        doing(array, n);
 
    }
 
   static void doing(int[] array, int n){;
        for(int i = 0; i < n; i++){
            int value = array[i];
            int j = i -1;
 
            while (j >= 0 && array[j] > value){
                array[j+1] = array[j];
                j--;
            }
            array[++ j] = value;
            
            
            
            
            for (j = 0; j < n; j++){
                System.out.print(array[j]);
                if (j != n-1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int [n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        doing(array, n);
 
    }
 
   static void doing(int[] array, int n){;
        for(int i = 0; i < n; i++){
            int value = array[i];
            int j = i -1;
 
            while (j >= 0 && array[j] > value){
                array[j+1] = array[j];
                j--;
            }
            array[++ j] = value;
            
            
            
            
            for (j = 0; j < n; j++){
                System.out.print(array[j]);
                if (j != n-1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int [n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        doing(array, n);
 
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int [n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        doing(array, n);
 
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] array = new int [n]; array new int [n] n for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            array[i] = sc.nextInt();
        } {
            array[i] = sc.nextInt();
        } array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc doing(array, n) doing array n String[] args args static void doing(int[] array, int n){;
        for(int i = 0; i < n; i++){
            int value = array[i];
            int j = i -1;
 
            while (j >= 0 && array[j] > value){
                array[j+1] = array[j];
                j--;
            }
            array[++ j] = value;
            
            
            
            
            for (j = 0; j < n; j++){
                System.out.print(array[j]);
                if (j != n-1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    } doing {;
        for(int i = 0; i < n; i++){
            int value = array[i];
            int j = i -1;
 
            while (j >= 0 && array[j] > value){
                array[j+1] = array[j];
                j--;
            }
            array[++ j] = value;
            
            
            
            
            for (j = 0; j < n; j++){
                System.out.print(array[j]);
                if (j != n-1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    } for(int i = 0; i < n; i++){
            int value = array[i];
            int j = i -1;
 
            while (j >= 0 && array[j] > value){
                array[j+1] = array[j];
                j--;
            }
            array[++ j] = value;
            
            
            
            
            for (j = 0; j < n; j++){
                System.out.print(array[j]);
                if (j != n-1)
                    System.out.print(" ");
            }
            System.out.println();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int value = array[i];
            int j = i -1;
 
            while (j >= 0 && array[j] > value){
                array[j+1] = array[j];
                j--;
            }
            array[++ j] = value;
            
            
            
            
            for (j = 0; j < n; j++){
                System.out.print(array[j]);
                if (j != n-1)
                    System.out.print(" ");
            }
            System.out.println();
        } {
            int value = array[i];
            int j = i -1;
 
            while (j >= 0 && array[j] > value){
                array[j+1] = array[j];
                j--;
            }
            array[++ j] = value;
            
            
            
            
            for (j = 0; j < n; j++){
                System.out.print(array[j]);
                if (j != n-1)
                    System.out.print(" ");
            }
            System.out.println();
        } int value = array[i]; value array[i] array i int j = i -1; j i -1 i 1 while (j >= 0 && array[j] > value){
                array[j+1] = array[j];
                j--;
            } j >= 0 && array[j] > value j >= 0 j 0 array[j] > value array[j] array j value {
                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] = value array[++ j] array ++ j j value for (j = 0; j < n; j++){
                System.out.print(array[j]);
                if (j != n-1)
                    System.out.print(" ");
            } j = 0; j = 0 j 0 j < n j n j++ j++ j {
                System.out.print(array[j]);
                if (j != n-1)
                    System.out.print(" ");
            } {
                System.out.print(array[j]);
                if (j != n-1)
                    System.out.print(" ");
            } System.out.print(array[j]) System.out.print System.out System System.out array[j] array j if (j != n-1)
                    System.out.print(" "); j != n-1 j n-1 n 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out int[] array array int n n public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int [n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        doing(array, n);
 
    }
 
   static void doing(int[] array, int n){;
        for(int i = 0; i < n; i++){
            int value = array[i];
            int j = i -1;
 
            while (j >= 0 && array[j] > value){
                array[j+1] = array[j];
                j--;
            }
            array[++ j] = value;
            
            
            
            
            for (j = 0; j < n; j++){
                System.out.print(array[j]);
                if (j != n-1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int [n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        doing(array, n);
 
    }
 
   static void doing(int[] array, int n){;
        for(int i = 0; i < n; i++){
            int value = array[i];
            int j = i -1;
 
            while (j >= 0 && array[j] > value){
                array[j+1] = array[j];
                j--;
            }
            array[++ j] = value;
            
            
            
            
            for (j = 0; j < n; j++){
                System.out.print(array[j]);
                if (j != n-1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
} Main
import java.util.Scanner;
 
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int [n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        doing(array, n);
 
    }
 
   static void doing(int[] array, int n){;
        for(int i = 0; i < n; i++){
            int value = array[i];
            int j = i -1;
 
            while (j >= 0 && array[j] > value){
                array[j+1] = array[j];
                j--;
            }
            array[++ j] = value;
            
            
            
            
            for (j = 0; j < n; j++){
                System.out.print(array[j]);
                if (j != n-1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
}