public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n;
    int[] a;
    int i, j, k, tmp;

    n = sc.nextInt();
    a = new int[n];

    for(i = 0;i < n;i++){
      a[i] = sc.nextInt();
    }

    for(i = 0;i < n;i++){
      for(j = 0;j < i;j++){
        if(a[j] > a[i]){
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        }
      }
      System.out.print(a[0]);
      for(j = 1;j < n;j++){
        System.out.print(" " + a[j]);
      }
      System.out.println();
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
} public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n;
    int[] a;
    int i, j, k, tmp;

    n = sc.nextInt();
    a = new int[n];

    for(i = 0;i < n;i++){
      a[i] = sc.nextInt();
    }

    for(i = 0;i < n;i++){
      for(j = 0;j < i;j++){
        if(a[j] > a[i]){
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        }
      }
      System.out.print(a[0]);
      for(j = 1;j < n;j++){
        System.out.print(" " + a[j]);
      }
      System.out.println();
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
} Main public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n;
    int[] a;
    int i, j, k, tmp;

    n = sc.nextInt();
    a = new int[n];

    for(i = 0;i < n;i++){
      a[i] = sc.nextInt();
    }

    for(i = 0;i < n;i++){
      for(j = 0;j < i;j++){
        if(a[j] > a[i]){
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        }
      }
      System.out.print(a[0]);
      for(j = 1;j < n;j++){
        System.out.print(" " + a[j]);
      }
      System.out.println();
    }

    sc.close();
  } run {
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n;
    int[] a;
    int i, j, k, tmp;

    n = sc.nextInt();
    a = new int[n];

    for(i = 0;i < n;i++){
      a[i] = sc.nextInt();
    }

    for(i = 0;i < n;i++){
      for(j = 0;j < i;j++){
        if(a[j] > a[i]){
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        }
      }
      System.out.print(a[0]);
      for(j = 1;j < n;j++){
        System.out.print(" " + a[j]);
      }
      System.out.println();
    }

    sc.close();
  } java.util.Scanner sc = new java.util.Scanner(in); sc new java.util.Scanner(in) int n; n int[] a; a int i i j j k k tmp; tmp n = sc.nextInt() n sc.nextInt() sc.nextInt sc a = new int[n] a new int[n] n for(i = 0;i < n;i++){
      a[i] = sc.nextInt();
    } i = 0; i = 0 i 0 i < n i n i++ i++ i {
      a[i] = sc.nextInt();
    } {
      a[i] = sc.nextInt();
    } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc for(i = 0;i < n;i++){
      for(j = 0;j < i;j++){
        if(a[j] > a[i]){
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        }
      }
      System.out.print(a[0]);
      for(j = 1;j < n;j++){
        System.out.print(" " + a[j]);
      }
      System.out.println();
    } i = 0; i = 0 i 0 i < n i n i++ i++ i {
      for(j = 0;j < i;j++){
        if(a[j] > a[i]){
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        }
      }
      System.out.print(a[0]);
      for(j = 1;j < n;j++){
        System.out.print(" " + a[j]);
      }
      System.out.println();
    } {
      for(j = 0;j < i;j++){
        if(a[j] > a[i]){
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        }
      }
      System.out.print(a[0]);
      for(j = 1;j < n;j++){
        System.out.print(" " + a[j]);
      }
      System.out.println();
    } for(j = 0;j < i;j++){
        if(a[j] > a[i]){
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        }
      } j = 0; j = 0 j 0 j < i j i j++ j++ j {
        if(a[j] > a[i]){
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        }
      } {
        if(a[j] > a[i]){
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        }
      } if(a[j] > a[i]){
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        } a[j] > a[i] a[j] a j a[i] a i {
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        } tmp = a[i] tmp a[i] a i for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          } k = 0; k = 0 k 0 k < (i - j) k (i - j) i j k++ k++ k {
            a[i - k] = a[i - k - 1];
          } {
            a[i - k] = a[i - k - 1];
          } a[i - k] = a[i - k - 1] a[i - k] a i - k i k a[i - k - 1] a i - k - 1 i - k - 1 i k 1 a[j] = tmp a[j] a j tmp System.out.print(a[0]) System.out.print System.out System System.out a[0] a 0 for(j = 1;j < n;j++){
        System.out.print(" " + a[j]);
      } j = 1; j = 1 j 1 j < n j n j++ j++ j {
        System.out.print(" " + a[j]);
      } {
        System.out.print(" " + a[j]);
      } System.out.print(" " + a[j]) System.out.print System.out System System.out " " + a[j] " " a[j] a j System.out.println() System.out.println System.out System System.out sc.close() sc.close sc java.io.InputStream in in java.io.PrintStream out out public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  } main {
    (new Main()).run(System.in, System.out);
  } (new Main()).run(System.in, System.out) (new Main()).run (new Main()) System.in System System.in System.out System System.out String[] args args public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n;
    int[] a;
    int i, j, k, tmp;

    n = sc.nextInt();
    a = new int[n];

    for(i = 0;i < n;i++){
      a[i] = sc.nextInt();
    }

    for(i = 0;i < n;i++){
      for(j = 0;j < i;j++){
        if(a[j] > a[i]){
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        }
      }
      System.out.print(a[0]);
      for(j = 1;j < n;j++){
        System.out.print(" " + a[j]);
      }
      System.out.println();
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
} public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n;
    int[] a;
    int i, j, k, tmp;

    n = sc.nextInt();
    a = new int[n];

    for(i = 0;i < n;i++){
      a[i] = sc.nextInt();
    }

    for(i = 0;i < n;i++){
      for(j = 0;j < i;j++){
        if(a[j] > a[i]){
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        }
      }
      System.out.print(a[0]);
      for(j = 1;j < n;j++){
        System.out.print(" " + a[j]);
      }
      System.out.println();
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
} Main
public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n;
    int[] a;
    int i, j, k, tmp;

    n = sc.nextInt();
    a = new int[n];

    for(i = 0;i < n;i++){
      a[i] = sc.nextInt();
    }

    for(i = 0;i < n;i++){
      for(j = 0;j < i;j++){
        if(a[j] > a[i]){
          tmp = a[i];
          for(k = 0;k < (i - j);k++){
            a[i - k] = a[i - k - 1];
          }
          a[j] = tmp;
        }
      }
      System.out.print(a[0]);
      for(j = 1;j < n;j++){
        System.out.print(" " + a[j]);
      }
      System.out.println();
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
}