import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.math.BigDecimal;

public class Main {
  static InputReader in;
  static PrintWriter out;

  static class Solution {
    void solve() throws IOException {
      int N = in.nextInt();
      int[] A = new int[N];
      for (int i = 0; i < N; i++) {
        A[i] = in.nextInt();
        out.print(A[i]);
        if (i != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
      }
      
      insertionSort(A, N);
     
//      End solve()
    }
    
    void insertionSort(int[] A, int N) {
      for (int i = 1; i < N; i++) {
        int v = A[i];
        int j = i - 1; 
        while (j >= 0 && A[j] > v) {
          A[j+1] = A[j];
          j--;
        }
        A[j+1] = v;
        
        for (int k = 0; k < N; k++) {
          out.print(A[k]);
          if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
        }
      }
    
    }
//    End Solution
}


  public static void main(String[] args) throws IOException {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
}


  static class InputReader {
    public BufferedReader br;
    public StringTokenizer st;

    public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    }

    public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    }

    public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken());
    }

    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    }

    public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    }

  }

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util import java.util.StringTokenizer; StringTokenizer java.util import java.math.BigDecimal; BigDecimal java.math public class Main {
  static InputReader in;
  static PrintWriter out;

  static class Solution {
    void solve() throws IOException {
      int N = in.nextInt();
      int[] A = new int[N];
      for (int i = 0; i < N; i++) {
        A[i] = in.nextInt();
        out.print(A[i]);
        if (i != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
      }
      
      insertionSort(A, N);
     
//      End solve()
    }
    
    void insertionSort(int[] A, int N) {
      for (int i = 1; i < N; i++) {
        int v = A[i];
        int j = i - 1; 
        while (j >= 0 && A[j] > v) {
          A[j+1] = A[j];
          j--;
        }
        A[j+1] = v;
        
        for (int k = 0; k < N; k++) {
          out.print(A[k]);
          if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
        }
      }
    
    }
//    End Solution
}


  public static void main(String[] args) throws IOException {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
}


  static class InputReader {
    public BufferedReader br;
    public StringTokenizer st;

    public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    }

    public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    }

    public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken());
    }

    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    }

    public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    }

  }

} Main static InputReader in; in static PrintWriter out; out public static void main(String[] args) throws IOException {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
} main {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
} in = new InputReader(System.in) in new InputReader(System.in) out = new PrintWriter(System.out) out new PrintWriter(System.out) Solution solver = new Solution(); solver new Solution() solver.solve() solver.solve solver out.close() out.close out String[] args args static class Solution {
    void solve() throws IOException {
      int N = in.nextInt();
      int[] A = new int[N];
      for (int i = 0; i < N; i++) {
        A[i] = in.nextInt();
        out.print(A[i]);
        if (i != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
      }
      
      insertionSort(A, N);
     
//      End solve()
    }
    
    void insertionSort(int[] A, int N) {
      for (int i = 1; i < N; i++) {
        int v = A[i];
        int j = i - 1; 
        while (j >= 0 && A[j] > v) {
          A[j+1] = A[j];
          j--;
        }
        A[j+1] = v;
        
        for (int k = 0; k < N; k++) {
          out.print(A[k]);
          if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
        }
      }
    
    }
//    End Solution
} Solution void solve() throws IOException {
      int N = in.nextInt();
      int[] A = new int[N];
      for (int i = 0; i < N; i++) {
        A[i] = in.nextInt();
        out.print(A[i]);
        if (i != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
      }
      
      insertionSort(A, N);
     
//      End solve()
    } solve {
      int N = in.nextInt();
      int[] A = new int[N];
      for (int i = 0; i < N; i++) {
        A[i] = in.nextInt();
        out.print(A[i]);
        if (i != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
      }
      
      insertionSort(A, N);
     
//      End solve()
    } int N = in.nextInt(); N in.nextInt() in.nextInt in int[] A = new int[N]; A new int[N] N for (int i = 0; i < N; i++) {
        A[i] = in.nextInt();
        out.print(A[i]);
        if (i != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
      } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
        A[i] = in.nextInt();
        out.print(A[i]);
        if (i != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
      } {
        A[i] = in.nextInt();
        out.print(A[i]);
        if (i != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
      } A[i] = in.nextInt() A[i] A i in.nextInt() in.nextInt in out.print(A[i]) out.print out A[i] A i if (i != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          } i != N - 1 i N - 1 N 1 {
            out.print(" ");
          } out.print(" ") out.print out " " {
            out.print("\n");
          } out.print("\n") out.print out "\n" insertionSort(A, N) insertionSort A N void insertionSort(int[] A, int N) {
      for (int i = 1; i < N; i++) {
        int v = A[i];
        int j = i - 1; 
        while (j >= 0 && A[j] > v) {
          A[j+1] = A[j];
          j--;
        }
        A[j+1] = v;
        
        for (int k = 0; k < N; k++) {
          out.print(A[k]);
          if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
        }
      }
    
    } insertionSort {
      for (int i = 1; i < N; i++) {
        int v = A[i];
        int j = i - 1; 
        while (j >= 0 && A[j] > v) {
          A[j+1] = A[j];
          j--;
        }
        A[j+1] = v;
        
        for (int k = 0; k < N; k++) {
          out.print(A[k]);
          if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
        }
      }
    
    } for (int i = 1; i < N; i++) {
        int v = A[i];
        int j = i - 1; 
        while (j >= 0 && A[j] > v) {
          A[j+1] = A[j];
          j--;
        }
        A[j+1] = v;
        
        for (int k = 0; k < N; k++) {
          out.print(A[k]);
          if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
        }
      } int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
        int v = A[i];
        int j = i - 1; 
        while (j >= 0 && A[j] > v) {
          A[j+1] = A[j];
          j--;
        }
        A[j+1] = v;
        
        for (int k = 0; k < N; k++) {
          out.print(A[k]);
          if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
        }
      } {
        int v = A[i];
        int j = i - 1; 
        while (j >= 0 && A[j] > v) {
          A[j+1] = A[j];
          j--;
        }
        A[j+1] = v;
        
        for (int k = 0; k < N; k++) {
          out.print(A[k]);
          if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
        }
      } int v = A[i]; v A[i] A i int 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 for (int k = 0; k < N; k++) {
          out.print(A[k]);
          if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
        } int k = 0; int k = 0; k 0 k < N k N k++ k++ k {
          out.print(A[k]);
          if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
        } {
          out.print(A[k]);
          if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
        } out.print(A[k]) out.print out A[k] A k if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          } k != N - 1 k N - 1 N 1 {
            out.print(" ");
          } out.print(" ") out.print out " " {
            out.print("\n");
          } out.print("\n") out.print out "\n" int[] A A int N N static class InputReader {
    public BufferedReader br;
    public StringTokenizer st;

    public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    }

    public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    }

    public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken());
    }

    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    }

    public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    }

  } InputReader public BufferedReader br; br public StringTokenizer st; st public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    } InputReader {
      br = new BufferedReader(new InputStreamReader(stream));
    } br = new BufferedReader(new InputStreamReader(stream)) br new BufferedReader(new InputStreamReader(stream)) InputStream stream stream public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    } nextInt {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    } while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
        st = new StringTokenizer(br.readLine());
      } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return Integer.parseInt(st.nextToken()); Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken());
    } nextLong {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken());
    } while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
        st = new StringTokenizer(br.readLine());
      } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return Long.parseLong(st.nextToken()); Long.parseLong(st.nextToken()) Long.parseLong Long st.nextToken() st.nextToken st public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    } next {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    } while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
        st = new StringTokenizer(br.readLine());
      } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    } nextDouble {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    } while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
        st = new StringTokenizer(br.readLine());
      } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return Double.parseDouble(st.nextToken()); Double.parseDouble(st.nextToken()) Double.parseDouble Double st.nextToken() st.nextToken st public class Main {
  static InputReader in;
  static PrintWriter out;

  static class Solution {
    void solve() throws IOException {
      int N = in.nextInt();
      int[] A = new int[N];
      for (int i = 0; i < N; i++) {
        A[i] = in.nextInt();
        out.print(A[i]);
        if (i != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
      }
      
      insertionSort(A, N);
     
//      End solve()
    }
    
    void insertionSort(int[] A, int N) {
      for (int i = 1; i < N; i++) {
        int v = A[i];
        int j = i - 1; 
        while (j >= 0 && A[j] > v) {
          A[j+1] = A[j];
          j--;
        }
        A[j+1] = v;
        
        for (int k = 0; k < N; k++) {
          out.print(A[k]);
          if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
        }
      }
    
    }
//    End Solution
}


  public static void main(String[] args) throws IOException {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
}


  static class InputReader {
    public BufferedReader br;
    public StringTokenizer st;

    public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    }

    public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    }

    public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken());
    }

    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    }

    public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    }

  }

} public class Main {
  static InputReader in;
  static PrintWriter out;

  static class Solution {
    void solve() throws IOException {
      int N = in.nextInt();
      int[] A = new int[N];
      for (int i = 0; i < N; i++) {
        A[i] = in.nextInt();
        out.print(A[i]);
        if (i != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
      }
      
      insertionSort(A, N);
     
//      End solve()
    }
    
    void insertionSort(int[] A, int N) {
      for (int i = 1; i < N; i++) {
        int v = A[i];
        int j = i - 1; 
        while (j >= 0 && A[j] > v) {
          A[j+1] = A[j];
          j--;
        }
        A[j+1] = v;
        
        for (int k = 0; k < N; k++) {
          out.print(A[k]);
          if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
        }
      }
    
    }
//    End Solution
}


  public static void main(String[] args) throws IOException {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
}


  static class InputReader {
    public BufferedReader br;
    public StringTokenizer st;

    public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    }

    public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    }

    public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken());
    }

    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    }

    public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    }

  }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.math.BigDecimal;

public class Main {
  static InputReader in;
  static PrintWriter out;

  static class Solution {
    void solve() throws IOException {
      int N = in.nextInt();
      int[] A = new int[N];
      for (int i = 0; i < N; i++) {
        A[i] = in.nextInt();
        out.print(A[i]);
        if (i != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
      }
      
      insertionSort(A, N);
     
//      End solve()
    }
    
    void insertionSort(int[] A, int N) {
      for (int i = 1; i < N; i++) {
        int v = A[i];
        int j = i - 1; 
        while (j >= 0 && A[j] > v) {
          A[j+1] = A[j];
          j--;
        }
        A[j+1] = v;
        
        for (int k = 0; k < N; k++) {
          out.print(A[k]);
          if (k != N - 1) {
            out.print(" ");
          } else {
            out.print("\n");
          }
        }
      }
    
    }
//    End Solution
}


  public static void main(String[] args) throws IOException {
    in = new InputReader(System.in);
    out = new PrintWriter(System.out);
    Solution solver = new Solution();
    solver.solve();
    out.close();
}


  static class InputReader {
    public BufferedReader br;
    public StringTokenizer st;

    public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream));
    }

    public int nextInt() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Integer.parseInt(st.nextToken());
    }

    public long nextLong() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Long.parseLong(st.nextToken());
    }

    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return st.nextToken();
    }

    public double nextDouble() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
        st = new StringTokenizer(br.readLine());
      }
      return Double.parseDouble(st.nextToken());
    }

  }

}