import java.util.Scanner;

class Main{
  static void output(int[] a){
    int i;
    for(i = 0; i < a.length - 1; i++)
      System.out.print(a[i] + " ");
    System.out.println(a[i]);
  }

  public static void main(String[] args){
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int a[] = new int[n];
    for(int i = 0; i < n; i++)
      a[i] = stdIn.nextInt();

    for(int i = 0; i < n; i++){
      int w = a[i];
      int j = i;
      while(j > 0 && a[j - 1] > w){
        a[j] = a[j - 1];
        j--;
      }
      a[j] = w;
      output(a);
    }

  }
} import java.util.Scanner; Scanner java.util class Main{
  static void output(int[] a){
    int i;
    for(i = 0; i < a.length - 1; i++)
      System.out.print(a[i] + " ");
    System.out.println(a[i]);
  }

  public static void main(String[] args){
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int a[] = new int[n];
    for(int i = 0; i < n; i++)
      a[i] = stdIn.nextInt();

    for(int i = 0; i < n; i++){
      int w = a[i];
      int j = i;
      while(j > 0 && a[j - 1] > w){
        a[j] = a[j - 1];
        j--;
      }
      a[j] = w;
      output(a);
    }

  }
} Main static void output(int[] a){
    int i;
    for(i = 0; i < a.length - 1; i++)
      System.out.print(a[i] + " ");
    System.out.println(a[i]);
  } output {
    int i;
    for(i = 0; i < a.length - 1; i++)
      System.out.print(a[i] + " ");
    System.out.println(a[i]);
  } int i; i for(i = 0; i < a.length - 1; i++)
      System.out.print(a[i] + " "); i = 0; i = 0 i 0 i < a.length - 1 i a.length - 1 a.length a a.length 1 i++ i++ i System.out.print(a[i] + " "); System.out.print(a[i] + " ") System.out.print System.out System System.out a[i] + " " a[i] a i " " System.out.println(a[i]) System.out.println System.out System System.out a[i] a i int[] a a public static void main(String[] args){
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int a[] = new int[n];
    for(int i = 0; i < n; i++)
      a[i] = stdIn.nextInt();

    for(int i = 0; i < n; i++){
      int w = a[i];
      int j = i;
      while(j > 0 && a[j - 1] > w){
        a[j] = a[j - 1];
        j--;
      }
      a[j] = w;
      output(a);
    }

  } main {
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int a[] = new int[n];
    for(int i = 0; i < n; i++)
      a[i] = stdIn.nextInt();

    for(int i = 0; i < n; i++){
      int w = a[i];
      int j = i;
      while(j > 0 && a[j - 1] > w){
        a[j] = a[j - 1];
        j--;
      }
      a[j] = w;
      output(a);
    }

  } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int a[] = new int[n]; a new int[n] n for(int i = 0; i < n; i++)
      a[i] = stdIn.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = stdIn.nextInt(); a[i] = stdIn.nextInt() a[i] a i stdIn.nextInt() stdIn.nextInt stdIn for(int i = 0; i < n; i++){
      int w = a[i];
      int j = i;
      while(j > 0 && a[j - 1] > w){
        a[j] = a[j - 1];
        j--;
      }
      a[j] = w;
      output(a);
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      int w = a[i];
      int j = i;
      while(j > 0 && a[j - 1] > w){
        a[j] = a[j - 1];
        j--;
      }
      a[j] = w;
      output(a);
    } {
      int w = a[i];
      int j = i;
      while(j > 0 && a[j - 1] > w){
        a[j] = a[j - 1];
        j--;
      }
      a[j] = w;
      output(a);
    } int w = a[i]; w a[i] a i int j = i; j i while(j > 0 && a[j - 1] > w){
        a[j] = a[j - 1];
        j--;
      } j > 0 && a[j - 1] > w j > 0 j 0 a[j - 1] > w a[j - 1] a j - 1 j 1 w {
        a[j] = a[j - 1];
        j--;
      } a[j] = a[j - 1] a[j] a j a[j - 1] a j - 1 j 1 j-- j a[j] = w a[j] a j w output(a) output a String[] args args
import java.util.Scanner;

class Main{
  static void output(int[] a){
    int i;
    for(i = 0; i < a.length - 1; i++)
      System.out.print(a[i] + " ");
    System.out.println(a[i]);
  }

  public static void main(String[] args){
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int a[] = new int[n];
    for(int i = 0; i < n; i++)
      a[i] = stdIn.nextInt();

    for(int i = 0; i < n; i++){
      int w = a[i];
      int j = i;
      while(j > 0 && a[j - 1] > w){
        a[j] = a[j - 1];
        j--;
      }
      a[j] = w;
      output(a);
    }

  }
}