/**
 * Created by akensho on 2015/11/22.
 */
import java.util.*;
class Main {
    static int n;
    static int[] a;
    static Scanner scanner = new Scanner(System.in);
    public static void main(String[] args){
        while( read() ){
            insertionSort(a);
        }
    }

    static boolean read(){
        if( !scanner.hasNext() ) return false;
        n = scanner.nextInt();
        a = new int[n];
        for(int i = 0; i < a.length; i++){
            a[i] = scanner.nextInt();
        }
        return true;
    }

    /**
     * ?????\??????????????????????????????
     * @param array := 0-indexed ??§ N ??????????´????????????????
     * return ????????????????????????
     */
    static int[] insertionSort(int[] array){
        for (int i = 0; i < array.length; i++) {
            int v = array[i];
            int j = i-1;
            while ( j >= 0 && array[j] > v ){
                array[j+1] = array[j];
                j--;
            }
            array[j+1] = v;
            traceArray(array);
        }
        return array;
    }

    static void traceArray(int[] array){
        for(int i = 0; i < array.length; i++){
            if (i == array.length - 1) {
                System.out.print(array[i]);
                continue;
            }
            System.out.print(array[i] + " ");
        }
        System.out.println();
    }

} import java.util.*; util.* java class Main {
    static int n;
    static int[] a;
    static Scanner scanner = new Scanner(System.in);
    public static void main(String[] args){
        while( read() ){
            insertionSort(a);
        }
    }

    static boolean read(){
        if( !scanner.hasNext() ) return false;
        n = scanner.nextInt();
        a = new int[n];
        for(int i = 0; i < a.length; i++){
            a[i] = scanner.nextInt();
        }
        return true;
    }

    /**
     * ?????\??????????????????????????????
     * @param array := 0-indexed ??§ N ??????????´????????????????
     * return ????????????????????????
     */
    static int[] insertionSort(int[] array){
        for (int i = 0; i < array.length; i++) {
            int v = array[i];
            int j = i-1;
            while ( j >= 0 && array[j] > v ){
                array[j+1] = array[j];
                j--;
            }
            array[j+1] = v;
            traceArray(array);
        }
        return array;
    }

    static void traceArray(int[] array){
        for(int i = 0; i < array.length; i++){
            if (i == array.length - 1) {
                System.out.print(array[i]);
                continue;
            }
            System.out.print(array[i] + " ");
        }
        System.out.println();
    }

} Main static int n; n static int[] a; a static Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) public static void main(String[] args){
        while( read() ){
            insertionSort(a);
        }
    } main {
        while( read() ){
            insertionSort(a);
        }
    } while( read() ){
            insertionSort(a);
        } read() read {
            insertionSort(a);
        } insertionSort(a) insertionSort a String[] args args static boolean read(){
        if( !scanner.hasNext() ) return false;
        n = scanner.nextInt();
        a = new int[n];
        for(int i = 0; i < a.length; i++){
            a[i] = scanner.nextInt();
        }
        return true;
    } read {
        if( !scanner.hasNext() ) return false;
        n = scanner.nextInt();
        a = new int[n];
        for(int i = 0; i < a.length; i++){
            a[i] = scanner.nextInt();
        }
        return true;
    } if( !scanner.hasNext() ) return false; !scanner.hasNext() scanner.hasNext() scanner.hasNext scanner return false; false n = scanner.nextInt() n scanner.nextInt() scanner.nextInt scanner a = new int[n] a new int[n] n for(int i = 0; i < a.length; i++){
            a[i] = scanner.nextInt();
        } int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
            a[i] = scanner.nextInt();
        } {
            a[i] = scanner.nextInt();
        } a[i] = scanner.nextInt() a[i] a i scanner.nextInt() scanner.nextInt scanner return true; true /**
     * ?????\??????????????????????????????
     * @param array := 0-indexed ??§ N ??????????´????????????????
     * return ????????????????????????
     */
    static int[] insertionSort(int[] array){
        for (int i = 0; i < array.length; i++) {
            int v = array[i];
            int j = i-1;
            while ( j >= 0 && array[j] > v ){
                array[j+1] = array[j];
                j--;
            }
            array[j+1] = v;
            traceArray(array);
        }
        return array;
    } insertionSort {
        for (int i = 0; i < array.length; i++) {
            int v = array[i];
            int j = i-1;
            while ( j >= 0 && array[j] > v ){
                array[j+1] = array[j];
                j--;
            }
            array[j+1] = v;
            traceArray(array);
        }
        return array;
    } for (int i = 0; i < array.length; i++) {
            int v = array[i];
            int j = i-1;
            while ( j >= 0 && array[j] > v ){
                array[j+1] = array[j];
                j--;
            }
            array[j+1] = v;
            traceArray(array);
        } int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i++ i++ i {
            int v = array[i];
            int j = i-1;
            while ( j >= 0 && array[j] > v ){
                array[j+1] = array[j];
                j--;
            }
            array[j+1] = v;
            traceArray(array);
        } {
            int v = array[i];
            int j = i-1;
            while ( j >= 0 && array[j] > v ){
                array[j+1] = array[j];
                j--;
            }
            array[j+1] = v;
            traceArray(array);
        } int v = array[i]; v array[i] array i int j = i-1; j i-1 i 1 while ( j >= 0 && array[j] > v ){
                array[j+1] = array[j];
                j--;
            } j >= 0 && array[j] > v j >= 0 j 0 array[j] > v array[j] array j v {
                array[j+1] = array[j];
                j--;
            } array[j+1] = array[j] array[j+1] array j+1 j 1 array[j] array j j-- j array[j+1] = v array[j+1] array j+1 j 1 v traceArray(array) traceArray array return array; array int[] array array static void traceArray(int[] array){
        for(int i = 0; i < array.length; i++){
            if (i == array.length - 1) {
                System.out.print(array[i]);
                continue;
            }
            System.out.print(array[i] + " ");
        }
        System.out.println();
    } traceArray {
        for(int i = 0; i < array.length; i++){
            if (i == array.length - 1) {
                System.out.print(array[i]);
                continue;
            }
            System.out.print(array[i] + " ");
        }
        System.out.println();
    } for(int i = 0; i < array.length; i++){
            if (i == array.length - 1) {
                System.out.print(array[i]);
                continue;
            }
            System.out.print(array[i] + " ");
        } int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i++ i++ i {
            if (i == array.length - 1) {
                System.out.print(array[i]);
                continue;
            }
            System.out.print(array[i] + " ");
        } {
            if (i == array.length - 1) {
                System.out.print(array[i]);
                continue;
            }
            System.out.print(array[i] + " ");
        } if (i == array.length - 1) {
                System.out.print(array[i]);
                continue;
            } i == array.length - 1 i array.length - 1 array.length array array.length 1 {
                System.out.print(array[i]);
                continue;
            } System.out.print(array[i]) System.out.print System.out System System.out array[i] array i continue; System.out.print(array[i] + " ") System.out.print System.out System System.out array[i] + " " array[i] array i " " System.out.println() System.out.println System.out System System.out int[] array array
/**
 * Created by akensho on 2015/11/22.
 */
import java.util.*;
class Main {
    static int n;
    static int[] a;
    static Scanner scanner = new Scanner(System.in);
    public static void main(String[] args){
        while( read() ){
            insertionSort(a);
        }
    }

    static boolean read(){
        if( !scanner.hasNext() ) return false;
        n = scanner.nextInt();
        a = new int[n];
        for(int i = 0; i < a.length; i++){
            a[i] = scanner.nextInt();
        }
        return true;
    }

    /**
     * ?????\??????????????????????????????
     * @param array := 0-indexed ??§ N ??????????´????????????????
     * return ????????????????????????
     */
    static int[] insertionSort(int[] array){
        for (int i = 0; i < array.length; i++) {
            int v = array[i];
            int j = i-1;
            while ( j >= 0 && array[j] > v ){
                array[j+1] = array[j];
                j--;
            }
            array[j+1] = v;
            traceArray(array);
        }
        return array;
    }

    static void traceArray(int[] array){
        for(int i = 0; i < array.length; i++){
            if (i == array.length - 1) {
                System.out.print(array[i]);
                continue;
            }
            System.out.print(array[i] + " ");
        }
        System.out.println();
    }

}