import java.io.*;
       
public class Main {
    public static void main(String[] args) throws IOException{
        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);
        int n = Integer.parseInt(br.readLine());
        String[] A = br.readLine().split(" ", 0);
        int i, j;
        String v;
                
        System.out.println(String.join(" ", A));
  
        for(i=1; i<n; i++){
            v = A[i];
            j = i - 1;
            while(j>=0 && Integer.parseInt(v)<Integer.parseInt(A[j])){
                A[j+1] = A[j];
                j--;
            }
            A[j+1] = v;
            System.out.println(String.join(" ", A));
        }
    }
} import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws IOException{
        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);
        int n = Integer.parseInt(br.readLine());
        String[] A = br.readLine().split(" ", 0);
        int i, j;
        String v;
                
        System.out.println(String.join(" ", A));
  
        for(i=1; i<n; i++){
            v = A[i];
            j = i - 1;
            while(j>=0 && Integer.parseInt(v)<Integer.parseInt(A[j])){
                A[j+1] = A[j];
                j--;
            }
            A[j+1] = v;
            System.out.println(String.join(" ", A));
        }
    }
} Main public static void main(String[] args) throws IOException{
        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);
        int n = Integer.parseInt(br.readLine());
        String[] A = br.readLine().split(" ", 0);
        int i, j;
        String v;
                
        System.out.println(String.join(" ", A));
  
        for(i=1; i<n; i++){
            v = A[i];
            j = i - 1;
            while(j>=0 && Integer.parseInt(v)<Integer.parseInt(A[j])){
                A[j+1] = A[j];
                j--;
            }
            A[j+1] = v;
            System.out.println(String.join(" ", A));
        }
    } main {
        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);
        int n = Integer.parseInt(br.readLine());
        String[] A = br.readLine().split(" ", 0);
        int i, j;
        String v;
                
        System.out.println(String.join(" ", A));
  
        for(i=1; i<n; i++){
            v = A[i];
            j = i - 1;
            while(j>=0 && Integer.parseInt(v)<Integer.parseInt(A[j])){
                A[j+1] = A[j];
                j--;
            }
            A[j+1] = v;
            System.out.println(String.join(" ", A));
        }
    } InputStreamReader is = new InputStreamReader(System.in); is new InputStreamReader(System.in) BufferedReader br = new BufferedReader(is); br new BufferedReader(is) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] A = br.readLine().split(" ", 0); A br.readLine().split(" ", 0) br.readLine().split br.readLine() br.readLine br " " 0 int i i j; j String v; v System.out.println(String.join(" ", A)) System.out.println System.out System System.out String.join(" ", A) String.join String " " A for(i=1; i<n; i++){
            v = A[i];
            j = i - 1;
            while(j>=0 && Integer.parseInt(v)<Integer.parseInt(A[j])){
                A[j+1] = A[j];
                j--;
            }
            A[j+1] = v;
            System.out.println(String.join(" ", A));
        } i=1; i=1 i 1 i<n i n i++ i++ i {
            v = A[i];
            j = i - 1;
            while(j>=0 && Integer.parseInt(v)<Integer.parseInt(A[j])){
                A[j+1] = A[j];
                j--;
            }
            A[j+1] = v;
            System.out.println(String.join(" ", A));
        } {
            v = A[i];
            j = i - 1;
            while(j>=0 && Integer.parseInt(v)<Integer.parseInt(A[j])){
                A[j+1] = A[j];
                j--;
            }
            A[j+1] = v;
            System.out.println(String.join(" ", A));
        } v = A[i] v A[i] A i j = i - 1 j i - 1 i 1 while(j>=0 && Integer.parseInt(v)<Integer.parseInt(A[j])){
                A[j+1] = A[j];
                j--;
            } j>=0 && Integer.parseInt(v)<Integer.parseInt(A[j]) j>=0 j 0 Integer.parseInt(v)<Integer.parseInt(A[j]) Integer.parseInt(v) Integer.parseInt Integer v Integer.parseInt(A[j]) Integer.parseInt Integer A[j] A j {
                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 System.out.println(String.join(" ", A)) System.out.println System.out System System.out String.join(" ", A) String.join String " " A String[] args args public class Main {
    public static void main(String[] args) throws IOException{
        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);
        int n = Integer.parseInt(br.readLine());
        String[] A = br.readLine().split(" ", 0);
        int i, j;
        String v;
                
        System.out.println(String.join(" ", A));
  
        for(i=1; i<n; i++){
            v = A[i];
            j = i - 1;
            while(j>=0 && Integer.parseInt(v)<Integer.parseInt(A[j])){
                A[j+1] = A[j];
                j--;
            }
            A[j+1] = v;
            System.out.println(String.join(" ", A));
        }
    }
} public class Main {
    public static void main(String[] args) throws IOException{
        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);
        int n = Integer.parseInt(br.readLine());
        String[] A = br.readLine().split(" ", 0);
        int i, j;
        String v;
                
        System.out.println(String.join(" ", A));
  
        for(i=1; i<n; i++){
            v = A[i];
            j = i - 1;
            while(j>=0 && Integer.parseInt(v)<Integer.parseInt(A[j])){
                A[j+1] = A[j];
                j--;
            }
            A[j+1] = v;
            System.out.println(String.join(" ", A));
        }
    }
} Main
import java.io.*;
       
public class Main {
    public static void main(String[] args) throws IOException{
        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);
        int n = Integer.parseInt(br.readLine());
        String[] A = br.readLine().split(" ", 0);
        int i, j;
        String v;
                
        System.out.println(String.join(" ", A));
  
        for(i=1; i<n; i++){
            v = A[i];
            j = i - 1;
            while(j>=0 && Integer.parseInt(v)<Integer.parseInt(A[j])){
                A[j+1] = A[j];
                j--;
            }
            A[j+1] = v;
            System.out.println(String.join(" ", A));
        }
    }
}