import java.io.*;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader( new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int nCount = Integer.parseInt(count);
      String s = new String(in.readLine());
      System.out.println(s);
      String[] arr = s.split(" ");
      for( int i = 1; i < nCount; i++ ) {
        String v = arr[i];
        int j = i - 1;
        while(j >= 0 && Integer.parseInt(arr[j]) > Integer.parseInt(v)) {
          arr[j+1] = arr[j];
          j--;
          arr[j+1] = v;
        }
        StringBuilder sb = new StringBuilder();
        for( String w : arr ) {
          sb.append(w).append(" ");
        }
        System.out.println(sb.toString().trim());
      }
    } catch (IOException e) {
      System.out.println(e.getMessage());
    }
  }
} import java.io.*; io.* java public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader( new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int nCount = Integer.parseInt(count);
      String s = new String(in.readLine());
      System.out.println(s);
      String[] arr = s.split(" ");
      for( int i = 1; i < nCount; i++ ) {
        String v = arr[i];
        int j = i - 1;
        while(j >= 0 && Integer.parseInt(arr[j]) > Integer.parseInt(v)) {
          arr[j+1] = arr[j];
          j--;
          arr[j+1] = v;
        }
        StringBuilder sb = new StringBuilder();
        for( String w : arr ) {
          sb.append(w).append(" ");
        }
        System.out.println(sb.toString().trim());
      }
    } catch (IOException e) {
      System.out.println(e.getMessage());
    }
  }
} Main public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader( new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int nCount = Integer.parseInt(count);
      String s = new String(in.readLine());
      System.out.println(s);
      String[] arr = s.split(" ");
      for( int i = 1; i < nCount; i++ ) {
        String v = arr[i];
        int j = i - 1;
        while(j >= 0 && Integer.parseInt(arr[j]) > Integer.parseInt(v)) {
          arr[j+1] = arr[j];
          j--;
          arr[j+1] = v;
        }
        StringBuilder sb = new StringBuilder();
        for( String w : arr ) {
          sb.append(w).append(" ");
        }
        System.out.println(sb.toString().trim());
      }
    } catch (IOException e) {
      System.out.println(e.getMessage());
    }
  } main {
    try {
      BufferedReader in = new BufferedReader( new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int nCount = Integer.parseInt(count);
      String s = new String(in.readLine());
      System.out.println(s);
      String[] arr = s.split(" ");
      for( int i = 1; i < nCount; i++ ) {
        String v = arr[i];
        int j = i - 1;
        while(j >= 0 && Integer.parseInt(arr[j]) > Integer.parseInt(v)) {
          arr[j+1] = arr[j];
          j--;
          arr[j+1] = v;
        }
        StringBuilder sb = new StringBuilder();
        for( String w : arr ) {
          sb.append(w).append(" ");
        }
        System.out.println(sb.toString().trim());
      }
    } catch (IOException e) {
      System.out.println(e.getMessage());
    }
  } try {
      BufferedReader in = new BufferedReader( new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int nCount = Integer.parseInt(count);
      String s = new String(in.readLine());
      System.out.println(s);
      String[] arr = s.split(" ");
      for( int i = 1; i < nCount; i++ ) {
        String v = arr[i];
        int j = i - 1;
        while(j >= 0 && Integer.parseInt(arr[j]) > Integer.parseInt(v)) {
          arr[j+1] = arr[j];
          j--;
          arr[j+1] = v;
        }
        StringBuilder sb = new StringBuilder();
        for( String w : arr ) {
          sb.append(w).append(" ");
        }
        System.out.println(sb.toString().trim());
      }
    } catch (IOException e) {
      System.out.println(e.getMessage());
    } catch (IOException e) {
      System.out.println(e.getMessage());
    } IOException e {
      System.out.println(e.getMessage());
    } System.out.println(e.getMessage()) System.out.println System.out System System.out e.getMessage() e.getMessage e {
      BufferedReader in = new BufferedReader( new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int nCount = Integer.parseInt(count);
      String s = new String(in.readLine());
      System.out.println(s);
      String[] arr = s.split(" ");
      for( int i = 1; i < nCount; i++ ) {
        String v = arr[i];
        int j = i - 1;
        while(j >= 0 && Integer.parseInt(arr[j]) > Integer.parseInt(v)) {
          arr[j+1] = arr[j];
          j--;
          arr[j+1] = v;
        }
        StringBuilder sb = new StringBuilder();
        for( String w : arr ) {
          sb.append(w).append(" ");
        }
        System.out.println(sb.toString().trim());
      }
    } BufferedReader in = new BufferedReader( new InputStreamReader(System.in)); in new BufferedReader( new InputStreamReader(System.in)) String count = new String(in.readLine()); count new String(in.readLine()) int nCount = Integer.parseInt(count); nCount Integer.parseInt(count) Integer.parseInt Integer count String s = new String(in.readLine()); s new String(in.readLine()) System.out.println(s) System.out.println System.out System System.out s String[] arr = s.split(" "); arr s.split(" ") s.split s " " for( int i = 1; i < nCount; i++ ) {
        String v = arr[i];
        int j = i - 1;
        while(j >= 0 && Integer.parseInt(arr[j]) > Integer.parseInt(v)) {
          arr[j+1] = arr[j];
          j--;
          arr[j+1] = v;
        }
        StringBuilder sb = new StringBuilder();
        for( String w : arr ) {
          sb.append(w).append(" ");
        }
        System.out.println(sb.toString().trim());
      } int i = 1; int i = 1; i 1 i < nCount i nCount i++ i++ i {
        String v = arr[i];
        int j = i - 1;
        while(j >= 0 && Integer.parseInt(arr[j]) > Integer.parseInt(v)) {
          arr[j+1] = arr[j];
          j--;
          arr[j+1] = v;
        }
        StringBuilder sb = new StringBuilder();
        for( String w : arr ) {
          sb.append(w).append(" ");
        }
        System.out.println(sb.toString().trim());
      } {
        String v = arr[i];
        int j = i - 1;
        while(j >= 0 && Integer.parseInt(arr[j]) > Integer.parseInt(v)) {
          arr[j+1] = arr[j];
          j--;
          arr[j+1] = v;
        }
        StringBuilder sb = new StringBuilder();
        for( String w : arr ) {
          sb.append(w).append(" ");
        }
        System.out.println(sb.toString().trim());
      } String v = arr[i]; v arr[i] arr i int j = i - 1; j i - 1 i 1 while(j >= 0 && Integer.parseInt(arr[j]) > Integer.parseInt(v)) {
          arr[j+1] = arr[j];
          j--;
          arr[j+1] = v;
        } j >= 0 && Integer.parseInt(arr[j]) > Integer.parseInt(v) j >= 0 j 0 Integer.parseInt(arr[j]) > Integer.parseInt(v) Integer.parseInt(arr[j]) Integer.parseInt Integer arr[j] arr j Integer.parseInt(v) Integer.parseInt Integer v {
          arr[j+1] = arr[j];
          j--;
          arr[j+1] = v;
        } arr[j+1] = arr[j] arr[j+1] arr j+1 j 1 arr[j] arr j j-- j arr[j+1] = v arr[j+1] arr j+1 j 1 v StringBuilder sb = new StringBuilder(); sb new StringBuilder() for( String w : arr ) {
          sb.append(w).append(" ");
        } String w arr {
          sb.append(w).append(" ");
        } {
          sb.append(w).append(" ");
        } sb.append(w).append(" ") sb.append(w).append sb.append(w) sb.append sb w " " System.out.println(sb.toString().trim()) System.out.println System.out System System.out sb.toString().trim() sb.toString().trim sb.toString() sb.toString sb String[] args args public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader( new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int nCount = Integer.parseInt(count);
      String s = new String(in.readLine());
      System.out.println(s);
      String[] arr = s.split(" ");
      for( int i = 1; i < nCount; i++ ) {
        String v = arr[i];
        int j = i - 1;
        while(j >= 0 && Integer.parseInt(arr[j]) > Integer.parseInt(v)) {
          arr[j+1] = arr[j];
          j--;
          arr[j+1] = v;
        }
        StringBuilder sb = new StringBuilder();
        for( String w : arr ) {
          sb.append(w).append(" ");
        }
        System.out.println(sb.toString().trim());
      }
    } catch (IOException e) {
      System.out.println(e.getMessage());
    }
  }
} public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader( new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int nCount = Integer.parseInt(count);
      String s = new String(in.readLine());
      System.out.println(s);
      String[] arr = s.split(" ");
      for( int i = 1; i < nCount; i++ ) {
        String v = arr[i];
        int j = i - 1;
        while(j >= 0 && Integer.parseInt(arr[j]) > Integer.parseInt(v)) {
          arr[j+1] = arr[j];
          j--;
          arr[j+1] = v;
        }
        StringBuilder sb = new StringBuilder();
        for( String w : arr ) {
          sb.append(w).append(" ");
        }
        System.out.println(sb.toString().trim());
      }
    } catch (IOException e) {
      System.out.println(e.getMessage());
    }
  }
} Main
import java.io.*;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader( new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int nCount = Integer.parseInt(count);
      String s = new String(in.readLine());
      System.out.println(s);
      String[] arr = s.split(" ");
      for( int i = 1; i < nCount; i++ ) {
        String v = arr[i];
        int j = i - 1;
        while(j >= 0 && Integer.parseInt(arr[j]) > Integer.parseInt(v)) {
          arr[j+1] = arr[j];
          j--;
          arr[j+1] = v;
        }
        StringBuilder sb = new StringBuilder();
        for( String w : arr ) {
          sb.append(w).append(" ");
        }
        System.out.println(sb.toString().trim());
      }
    } catch (IOException e) {
      System.out.println(e.getMessage());
    }
  }
}