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

