import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 * Created by hwzheng on 2017/3/26.
 */
public class Main {
    public static void main(String[] args) throws Exception{
        BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in));
        int j=0;
        int N = Integer.parseInt(Reader.readLine());
        String A[] = Reader.readLine().split(" ",0);
        int[] arr = new int[N];
        for (int i=0; i < N; i++){
            arr[i] = Integer.parseInt(A[i]);
        }
        insertionSort(arr,N);
    }

    private static void insertionSort(int[] arr, int n) {
        for (int i = 0; i < n; i++){
            int v = arr[i];
            int j = i - 1;
            while (j >= 0 && arr[j] > v){
                arr[j + 1] = arr[j];
                j--;
            }
            arr[j + 1] = v;
            String s = "";
            for (int anArr : arr) {
                s = s + anArr + " ";
            }
            System.out.println(s.trim());
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws Exception{
        BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in));
        int j=0;
        int N = Integer.parseInt(Reader.readLine());
        String A[] = Reader.readLine().split(" ",0);
        int[] arr = new int[N];
        for (int i=0; i < N; i++){
            arr[i] = Integer.parseInt(A[i]);
        }
        insertionSort(arr,N);
    }

    private static void insertionSort(int[] arr, int n) {
        for (int i = 0; i < n; i++){
            int v = arr[i];
            int j = i - 1;
            while (j >= 0 && arr[j] > v){
                arr[j + 1] = arr[j];
                j--;
            }
            arr[j + 1] = v;
            String s = "";
            for (int anArr : arr) {
                s = s + anArr + " ";
            }
            System.out.println(s.trim());
        }
    }
} Main public static void main(String[] args) throws Exception{
        BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in));
        int j=0;
        int N = Integer.parseInt(Reader.readLine());
        String A[] = Reader.readLine().split(" ",0);
        int[] arr = new int[N];
        for (int i=0; i < N; i++){
            arr[i] = Integer.parseInt(A[i]);
        }
        insertionSort(arr,N);
    } main {
        BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in));
        int j=0;
        int N = Integer.parseInt(Reader.readLine());
        String A[] = Reader.readLine().split(" ",0);
        int[] arr = new int[N];
        for (int i=0; i < N; i++){
            arr[i] = Integer.parseInt(A[i]);
        }
        insertionSort(arr,N);
    } BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in)); Reader new BufferedReader (new InputStreamReader(System.in)) int j=0; j 0 int N = Integer.parseInt(Reader.readLine()); N Integer.parseInt(Reader.readLine()) Integer.parseInt Integer Reader.readLine() Reader.readLine Reader String A[] = Reader.readLine().split(" ",0); A Reader.readLine().split(" ",0) Reader.readLine().split Reader.readLine() Reader.readLine Reader " " 0 int[] arr = new int[N]; arr new int[N] N for (int i=0; i < N; i++){
            arr[i] = Integer.parseInt(A[i]);
        } int i=0; int i=0; i 0 i < N i N i++ i++ i {
            arr[i] = Integer.parseInt(A[i]);
        } {
            arr[i] = Integer.parseInt(A[i]);
        } arr[i] = Integer.parseInt(A[i]) arr[i] arr i Integer.parseInt(A[i]) Integer.parseInt Integer A[i] A i insertionSort(arr,N) insertionSort arr N String[] args args private static void insertionSort(int[] arr, int n) {
        for (int i = 0; i < n; i++){
            int v = arr[i];
            int j = i - 1;
            while (j >= 0 && arr[j] > v){
                arr[j + 1] = arr[j];
                j--;
            }
            arr[j + 1] = v;
            String s = "";
            for (int anArr : arr) {
                s = s + anArr + " ";
            }
            System.out.println(s.trim());
        }
    } insertionSort {
        for (int i = 0; i < n; i++){
            int v = arr[i];
            int j = i - 1;
            while (j >= 0 && arr[j] > v){
                arr[j + 1] = arr[j];
                j--;
            }
            arr[j + 1] = v;
            String s = "";
            for (int anArr : arr) {
                s = s + anArr + " ";
            }
            System.out.println(s.trim());
        }
    } for (int i = 0; i < n; i++){
            int v = arr[i];
            int j = i - 1;
            while (j >= 0 && arr[j] > v){
                arr[j + 1] = arr[j];
                j--;
            }
            arr[j + 1] = v;
            String s = "";
            for (int anArr : arr) {
                s = s + anArr + " ";
            }
            System.out.println(s.trim());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int v = arr[i];
            int j = i - 1;
            while (j >= 0 && arr[j] > v){
                arr[j + 1] = arr[j];
                j--;
            }
            arr[j + 1] = v;
            String s = "";
            for (int anArr : arr) {
                s = s + anArr + " ";
            }
            System.out.println(s.trim());
        } {
            int v = arr[i];
            int j = i - 1;
            while (j >= 0 && arr[j] > v){
                arr[j + 1] = arr[j];
                j--;
            }
            arr[j + 1] = v;
            String s = "";
            for (int anArr : arr) {
                s = s + anArr + " ";
            }
            System.out.println(s.trim());
        } int v = arr[i]; v arr[i] arr i int j = i - 1; j i - 1 i 1 while (j >= 0 && arr[j] > v){
                arr[j + 1] = arr[j];
                j--;
            } j >= 0 && arr[j] > v j >= 0 j 0 arr[j] > v arr[j] arr j v {
                arr[j + 1] = arr[j];
                j--;
            } 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 String s = ""; s "" for (int anArr : arr) {
                s = s + anArr + " ";
            } int anArr arr {
                s = s + anArr + " ";
            } {
                s = s + anArr + " ";
            } s = s + anArr + " " s s + anArr + " " s + anArr + " " s anArr " " System.out.println(s.trim()) System.out.println System.out System System.out s.trim() s.trim s int[] arr arr int n n public class Main {
    public static void main(String[] args) throws Exception{
        BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in));
        int j=0;
        int N = Integer.parseInt(Reader.readLine());
        String A[] = Reader.readLine().split(" ",0);
        int[] arr = new int[N];
        for (int i=0; i < N; i++){
            arr[i] = Integer.parseInt(A[i]);
        }
        insertionSort(arr,N);
    }

    private static void insertionSort(int[] arr, int n) {
        for (int i = 0; i < n; i++){
            int v = arr[i];
            int j = i - 1;
            while (j >= 0 && arr[j] > v){
                arr[j + 1] = arr[j];
                j--;
            }
            arr[j + 1] = v;
            String s = "";
            for (int anArr : arr) {
                s = s + anArr + " ";
            }
            System.out.println(s.trim());
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception{
        BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in));
        int j=0;
        int N = Integer.parseInt(Reader.readLine());
        String A[] = Reader.readLine().split(" ",0);
        int[] arr = new int[N];
        for (int i=0; i < N; i++){
            arr[i] = Integer.parseInt(A[i]);
        }
        insertionSort(arr,N);
    }

    private static void insertionSort(int[] arr, int n) {
        for (int i = 0; i < n; i++){
            int v = arr[i];
            int j = i - 1;
            while (j >= 0 && arr[j] > v){
                arr[j + 1] = arr[j];
                j--;
            }
            arr[j + 1] = v;
            String s = "";
            for (int anArr : arr) {
                s = s + anArr + " ";
            }
            System.out.println(s.trim());
        }
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 * Created by hwzheng on 2017/3/26.
 */
public class Main {
    public static void main(String[] args) throws Exception{
        BufferedReader Reader = new BufferedReader (new InputStreamReader(System.in));
        int j=0;
        int N = Integer.parseInt(Reader.readLine());
        String A[] = Reader.readLine().split(" ",0);
        int[] arr = new int[N];
        for (int i=0; i < N; i++){
            arr[i] = Integer.parseInt(A[i]);
        }
        insertionSort(arr,N);
    }

    private static void insertionSort(int[] arr, int n) {
        for (int i = 0; i < n; i++){
            int v = arr[i];
            int j = i - 1;
            while (j >= 0 && arr[j] > v){
                arr[j + 1] = arr[j];
                j--;
            }
            arr[j + 1] = v;
            String s = "";
            for (int anArr : arr) {
                s = s + anArr + " ";
            }
            System.out.println(s.trim());
        }
    }
}