import java.io.*;
public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder stb=new StringBuilder();
        int a=Integer.parseInt(buf.readLine());
        int[] h=new int[a];
        String[] str=buf.readLine().split(" ");
        
        for(int i=0;i<h.length;i++){
            h[i]=Integer.parseInt(str[i]);
        }
        Sert(h,a);
    }
        
public static void Sert(int[] h,int a){
        int v,j;
        for(int i=0;i<h.length;i++){
             v=h[i];
             j=i-1;
             while(j>=0 && h[j]>v){
                 h[j+1]=h[j];
                 j--;
             }
             h[j+1]=v;
             toArray(h);
        }
    }

public static void toArray(int[] h){
    StringBuilder sbu=new StringBuilder();
    for(int i=0;i<h.length;i++){
      sbu.append(h[i]); 
      if(i<h.length-1)sbu.append(" ");
    }
    System.out.println(sbu);
    }
} import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder stb=new StringBuilder();
        int a=Integer.parseInt(buf.readLine());
        int[] h=new int[a];
        String[] str=buf.readLine().split(" ");
        
        for(int i=0;i<h.length;i++){
            h[i]=Integer.parseInt(str[i]);
        }
        Sert(h,a);
    }
        
public static void Sert(int[] h,int a){
        int v,j;
        for(int i=0;i<h.length;i++){
             v=h[i];
             j=i-1;
             while(j>=0 && h[j]>v){
                 h[j+1]=h[j];
                 j--;
             }
             h[j+1]=v;
             toArray(h);
        }
    }

public static void toArray(int[] h){
    StringBuilder sbu=new StringBuilder();
    for(int i=0;i<h.length;i++){
      sbu.append(h[i]); 
      if(i<h.length-1)sbu.append(" ");
    }
    System.out.println(sbu);
    }
} Main public static void main(String[] args) throws IOException{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder stb=new StringBuilder();
        int a=Integer.parseInt(buf.readLine());
        int[] h=new int[a];
        String[] str=buf.readLine().split(" ");
        
        for(int i=0;i<h.length;i++){
            h[i]=Integer.parseInt(str[i]);
        }
        Sert(h,a);
    } main {
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder stb=new StringBuilder();
        int a=Integer.parseInt(buf.readLine());
        int[] h=new int[a];
        String[] str=buf.readLine().split(" ");
        
        for(int i=0;i<h.length;i++){
            h[i]=Integer.parseInt(str[i]);
        }
        Sert(h,a);
    } BufferedReader buf=new BufferedReader(new InputStreamReader(System.in)); buf new BufferedReader(new InputStreamReader(System.in)) StringBuilder stb=new StringBuilder(); stb new StringBuilder() int a=Integer.parseInt(buf.readLine()); a Integer.parseInt(buf.readLine()) Integer.parseInt Integer buf.readLine() buf.readLine buf int[] h=new int[a]; h new int[a] a String[] str=buf.readLine().split(" "); str buf.readLine().split(" ") buf.readLine().split buf.readLine() buf.readLine buf " " for(int i=0;i<h.length;i++){
            h[i]=Integer.parseInt(str[i]);
        } int i=0; int i=0; i 0 i<h.length i h.length h h.length i++ i++ i {
            h[i]=Integer.parseInt(str[i]);
        } {
            h[i]=Integer.parseInt(str[i]);
        } h[i]=Integer.parseInt(str[i]) h[i] h i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i Sert(h,a) Sert h a String[] args args public static void Sert(int[] h,int a){
        int v,j;
        for(int i=0;i<h.length;i++){
             v=h[i];
             j=i-1;
             while(j>=0 && h[j]>v){
                 h[j+1]=h[j];
                 j--;
             }
             h[j+1]=v;
             toArray(h);
        }
    } Sert {
        int v,j;
        for(int i=0;i<h.length;i++){
             v=h[i];
             j=i-1;
             while(j>=0 && h[j]>v){
                 h[j+1]=h[j];
                 j--;
             }
             h[j+1]=v;
             toArray(h);
        }
    } int v v j; j for(int i=0;i<h.length;i++){
             v=h[i];
             j=i-1;
             while(j>=0 && h[j]>v){
                 h[j+1]=h[j];
                 j--;
             }
             h[j+1]=v;
             toArray(h);
        } int i=0; int i=0; i 0 i<h.length i h.length h h.length i++ i++ i {
             v=h[i];
             j=i-1;
             while(j>=0 && h[j]>v){
                 h[j+1]=h[j];
                 j--;
             }
             h[j+1]=v;
             toArray(h);
        } {
             v=h[i];
             j=i-1;
             while(j>=0 && h[j]>v){
                 h[j+1]=h[j];
                 j--;
             }
             h[j+1]=v;
             toArray(h);
        } v=h[i] v h[i] h i j=i-1 j i-1 i 1 while(j>=0 && h[j]>v){
                 h[j+1]=h[j];
                 j--;
             } j>=0 && h[j]>v j>=0 j 0 h[j]>v h[j] h j v {
                 h[j+1]=h[j];
                 j--;
             } h[j+1]=h[j] h[j+1] h j+1 j 1 h[j] h j j-- j h[j+1]=v h[j+1] h j+1 j 1 v toArray(h) toArray h int[] h h int a a public static void toArray(int[] h){
    StringBuilder sbu=new StringBuilder();
    for(int i=0;i<h.length;i++){
      sbu.append(h[i]); 
      if(i<h.length-1)sbu.append(" ");
    }
    System.out.println(sbu);
    } toArray {
    StringBuilder sbu=new StringBuilder();
    for(int i=0;i<h.length;i++){
      sbu.append(h[i]); 
      if(i<h.length-1)sbu.append(" ");
    }
    System.out.println(sbu);
    } StringBuilder sbu=new StringBuilder(); sbu new StringBuilder() for(int i=0;i<h.length;i++){
      sbu.append(h[i]); 
      if(i<h.length-1)sbu.append(" ");
    } int i=0; int i=0; i 0 i<h.length i h.length h h.length i++ i++ i {
      sbu.append(h[i]); 
      if(i<h.length-1)sbu.append(" ");
    } {
      sbu.append(h[i]); 
      if(i<h.length-1)sbu.append(" ");
    } sbu.append(h[i]) sbu.append sbu h[i] h i if(i<h.length-1)sbu.append(" "); i<h.length-1 i h.length-1 h.length h h.length 1 sbu.append(" ") sbu.append sbu " " System.out.println(sbu) System.out.println System.out System System.out sbu int[] h h public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder stb=new StringBuilder();
        int a=Integer.parseInt(buf.readLine());
        int[] h=new int[a];
        String[] str=buf.readLine().split(" ");
        
        for(int i=0;i<h.length;i++){
            h[i]=Integer.parseInt(str[i]);
        }
        Sert(h,a);
    }
        
public static void Sert(int[] h,int a){
        int v,j;
        for(int i=0;i<h.length;i++){
             v=h[i];
             j=i-1;
             while(j>=0 && h[j]>v){
                 h[j+1]=h[j];
                 j--;
             }
             h[j+1]=v;
             toArray(h);
        }
    }

public static void toArray(int[] h){
    StringBuilder sbu=new StringBuilder();
    for(int i=0;i<h.length;i++){
      sbu.append(h[i]); 
      if(i<h.length-1)sbu.append(" ");
    }
    System.out.println(sbu);
    }
} public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder stb=new StringBuilder();
        int a=Integer.parseInt(buf.readLine());
        int[] h=new int[a];
        String[] str=buf.readLine().split(" ");
        
        for(int i=0;i<h.length;i++){
            h[i]=Integer.parseInt(str[i]);
        }
        Sert(h,a);
    }
        
public static void Sert(int[] h,int a){
        int v,j;
        for(int i=0;i<h.length;i++){
             v=h[i];
             j=i-1;
             while(j>=0 && h[j]>v){
                 h[j+1]=h[j];
                 j--;
             }
             h[j+1]=v;
             toArray(h);
        }
    }

public static void toArray(int[] h){
    StringBuilder sbu=new StringBuilder();
    for(int i=0;i<h.length;i++){
      sbu.append(h[i]); 
      if(i<h.length-1)sbu.append(" ");
    }
    System.out.println(sbu);
    }
} Main
import java.io.*;
public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder stb=new StringBuilder();
        int a=Integer.parseInt(buf.readLine());
        int[] h=new int[a];
        String[] str=buf.readLine().split(" ");
        
        for(int i=0;i<h.length;i++){
            h[i]=Integer.parseInt(str[i]);
        }
        Sert(h,a);
    }
        
public static void Sert(int[] h,int a){
        int v,j;
        for(int i=0;i<h.length;i++){
             v=h[i];
             j=i-1;
             while(j>=0 && h[j]>v){
                 h[j+1]=h[j];
                 j--;
             }
             h[j+1]=v;
             toArray(h);
        }
    }

public static void toArray(int[] h){
    StringBuilder sbu=new StringBuilder();
    for(int i=0;i<h.length;i++){
      sbu.append(h[i]); 
      if(i<h.length-1)sbu.append(" ");
    }
    System.out.println(sbu);
    }
}