import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int n = scn.nextInt();
        insertionSort(createArray(n), n);
    }
    
    private static int[] createArray(int n) {
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) {
            ary[i] = scn.nextInt();
        }
        return ary;
    }
    
    private static void showArray(int[] ary) {
        StringBuilder sb = new StringBuilder();
        for(int elm : ary) {
            sb.append(elm + " ");
        }
        System.out.println(sb.toString().trim());
    }
    
    private static void insertionSort(int[] ary, int n) {
        showArray(ary);
        for(int i = 1; i < n; i++) {
            int v = ary[i];
            int j = i - 1;
            while(j >= 0 && ary[j] > v) {
                ary[j + 1] = ary[j];
                j--;
            }
            ary[j + 1] = v;
            showArray(ary);
        }
    }
} import java.util.*; util.* java public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int n = scn.nextInt();
        insertionSort(createArray(n), n);
    }
    
    private static int[] createArray(int n) {
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) {
            ary[i] = scn.nextInt();
        }
        return ary;
    }
    
    private static void showArray(int[] ary) {
        StringBuilder sb = new StringBuilder();
        for(int elm : ary) {
            sb.append(elm + " ");
        }
        System.out.println(sb.toString().trim());
    }
    
    private static void insertionSort(int[] ary, int n) {
        showArray(ary);
        for(int i = 1; i < n; i++) {
            int v = ary[i];
            int j = i - 1;
            while(j >= 0 && ary[j] > v) {
                ary[j + 1] = ary[j];
                j--;
            }
            ary[j + 1] = v;
            showArray(ary);
        }
    }
} Main private static final Scanner scn = new Scanner(System.in); scn new Scanner(System.in) public static void main(String[] args) {
        int n = scn.nextInt();
        insertionSort(createArray(n), n);
    } main {
        int n = scn.nextInt();
        insertionSort(createArray(n), n);
    } int n = scn.nextInt(); n scn.nextInt() scn.nextInt scn insertionSort(createArray(n), n) insertionSort createArray(n) createArray n n String[] args args private static int[] createArray(int n) {
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) {
            ary[i] = scn.nextInt();
        }
        return ary;
    } createArray {
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) {
            ary[i] = scn.nextInt();
        }
        return ary;
    } int[] ary = new int[n]; ary new int[n] n for(int i = 0; i < n; i++) {
            ary[i] = scn.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            ary[i] = scn.nextInt();
        } {
            ary[i] = scn.nextInt();
        } ary[i] = scn.nextInt() ary[i] ary i scn.nextInt() scn.nextInt scn return ary; ary int n n private static void showArray(int[] ary) {
        StringBuilder sb = new StringBuilder();
        for(int elm : ary) {
            sb.append(elm + " ");
        }
        System.out.println(sb.toString().trim());
    } showArray {
        StringBuilder sb = new StringBuilder();
        for(int elm : ary) {
            sb.append(elm + " ");
        }
        System.out.println(sb.toString().trim());
    } StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int elm : ary) {
            sb.append(elm + " ");
        } int elm ary {
            sb.append(elm + " ");
        } {
            sb.append(elm + " ");
        } sb.append(elm + " ") sb.append sb elm + " " elm " " 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 int[] ary ary private static void insertionSort(int[] ary, int n) {
        showArray(ary);
        for(int i = 1; i < n; i++) {
            int v = ary[i];
            int j = i - 1;
            while(j >= 0 && ary[j] > v) {
                ary[j + 1] = ary[j];
                j--;
            }
            ary[j + 1] = v;
            showArray(ary);
        }
    } insertionSort {
        showArray(ary);
        for(int i = 1; i < n; i++) {
            int v = ary[i];
            int j = i - 1;
            while(j >= 0 && ary[j] > v) {
                ary[j + 1] = ary[j];
                j--;
            }
            ary[j + 1] = v;
            showArray(ary);
        }
    } showArray(ary) showArray ary for(int i = 1; i < n; i++) {
            int v = ary[i];
            int j = i - 1;
            while(j >= 0 && ary[j] > v) {
                ary[j + 1] = ary[j];
                j--;
            }
            ary[j + 1] = v;
            showArray(ary);
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            int v = ary[i];
            int j = i - 1;
            while(j >= 0 && ary[j] > v) {
                ary[j + 1] = ary[j];
                j--;
            }
            ary[j + 1] = v;
            showArray(ary);
        } {
            int v = ary[i];
            int j = i - 1;
            while(j >= 0 && ary[j] > v) {
                ary[j + 1] = ary[j];
                j--;
            }
            ary[j + 1] = v;
            showArray(ary);
        } int v = ary[i]; v ary[i] ary i int j = i - 1; j i - 1 i 1 while(j >= 0 && ary[j] > v) {
                ary[j + 1] = ary[j];
                j--;
            } j >= 0 && ary[j] > v j >= 0 j 0 ary[j] > v ary[j] ary j v {
                ary[j + 1] = ary[j];
                j--;
            } ary[j + 1] = ary[j] ary[j + 1] ary j + 1 j 1 ary[j] ary j j-- j ary[j + 1] = v ary[j + 1] ary j + 1 j 1 v showArray(ary) showArray ary int[] ary ary int n n public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int n = scn.nextInt();
        insertionSort(createArray(n), n);
    }
    
    private static int[] createArray(int n) {
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) {
            ary[i] = scn.nextInt();
        }
        return ary;
    }
    
    private static void showArray(int[] ary) {
        StringBuilder sb = new StringBuilder();
        for(int elm : ary) {
            sb.append(elm + " ");
        }
        System.out.println(sb.toString().trim());
    }
    
    private static void insertionSort(int[] ary, int n) {
        showArray(ary);
        for(int i = 1; i < n; i++) {
            int v = ary[i];
            int j = i - 1;
            while(j >= 0 && ary[j] > v) {
                ary[j + 1] = ary[j];
                j--;
            }
            ary[j + 1] = v;
            showArray(ary);
        }
    }
} public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int n = scn.nextInt();
        insertionSort(createArray(n), n);
    }
    
    private static int[] createArray(int n) {
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) {
            ary[i] = scn.nextInt();
        }
        return ary;
    }
    
    private static void showArray(int[] ary) {
        StringBuilder sb = new StringBuilder();
        for(int elm : ary) {
            sb.append(elm + " ");
        }
        System.out.println(sb.toString().trim());
    }
    
    private static void insertionSort(int[] ary, int n) {
        showArray(ary);
        for(int i = 1; i < n; i++) {
            int v = ary[i];
            int j = i - 1;
            while(j >= 0 && ary[j] > v) {
                ary[j + 1] = ary[j];
                j--;
            }
            ary[j + 1] = v;
            showArray(ary);
        }
    }
} Main
import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int n = scn.nextInt();
        insertionSort(createArray(n), n);
    }
    
    private static int[] createArray(int n) {
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) {
            ary[i] = scn.nextInt();
        }
        return ary;
    }
    
    private static void showArray(int[] ary) {
        StringBuilder sb = new StringBuilder();
        for(int elm : ary) {
            sb.append(elm + " ");
        }
        System.out.println(sb.toString().trim());
    }
    
    private static void insertionSort(int[] ary, int n) {
        showArray(ary);
        for(int i = 1; i < n; i++) {
            int v = ary[i];
            int j = i - 1;
            while(j >= 0 && ary[j] > v) {
                ary[j + 1] = ary[j];
                j--;
            }
            ary[j + 1] = v;
            showArray(ary);
        }
    }
}