
import java.util.Scanner;

/**
 * Created by ??\??? on 2016/12/2.
 */
public class Main {
    static void print(Object[] array)
    {
        for(int i = 0;i<array.length;i++)
        {
            if(i==0)
                System.out.print(array[i].toString());
            else
                System.out.print(" "+array[i].toString());
        }
        System.out.println();
    }
    static int run(String[] args)
    {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            String[] array = scan.nextLine().split(" ");
            for (int i = 1; i <= T; i++) {
                if (i == 1)
                    print(array);
                else {
                    int pointer = i - 1;
                    for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    }
                    print(array);
                }
            }
        }
        return 0;
    }
    public static void main(String[] args)
    {
        run(args);
    }

} import java.util.Scanner; Scanner java.util public class Main {
    static void print(Object[] array)
    {
        for(int i = 0;i<array.length;i++)
        {
            if(i==0)
                System.out.print(array[i].toString());
            else
                System.out.print(" "+array[i].toString());
        }
        System.out.println();
    }
    static int run(String[] args)
    {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            String[] array = scan.nextLine().split(" ");
            for (int i = 1; i <= T; i++) {
                if (i == 1)
                    print(array);
                else {
                    int pointer = i - 1;
                    for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    }
                    print(array);
                }
            }
        }
        return 0;
    }
    public static void main(String[] args)
    {
        run(args);
    }

} Main static void print(Object[] array)
    {
        for(int i = 0;i<array.length;i++)
        {
            if(i==0)
                System.out.print(array[i].toString());
            else
                System.out.print(" "+array[i].toString());
        }
        System.out.println();
    } print {
        for(int i = 0;i<array.length;i++)
        {
            if(i==0)
                System.out.print(array[i].toString());
            else
                System.out.print(" "+array[i].toString());
        }
        System.out.println();
    } for(int i = 0;i<array.length;i++)
        {
            if(i==0)
                System.out.print(array[i].toString());
            else
                System.out.print(" "+array[i].toString());
        } int i = 0; int i = 0; i 0 i<array.length i array.length array array.length i++ i++ i {
            if(i==0)
                System.out.print(array[i].toString());
            else
                System.out.print(" "+array[i].toString());
        } {
            if(i==0)
                System.out.print(array[i].toString());
            else
                System.out.print(" "+array[i].toString());
        } if(i==0)
                System.out.print(array[i].toString());
            else
                System.out.print(" "+array[i].toString()); i==0 i 0 System.out.print(array[i].toString()) System.out.print System.out System System.out array[i].toString() array[i].toString array[i] array i System.out.print(" "+array[i].toString()) System.out.print System.out System System.out " "+array[i].toString() " " array[i].toString() array[i].toString array[i] array i System.out.println() System.out.println System.out System System.out Object[] array array static int run(String[] args)
    {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            String[] array = scan.nextLine().split(" ");
            for (int i = 1; i <= T; i++) {
                if (i == 1)
                    print(array);
                else {
                    int pointer = i - 1;
                    for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    }
                    print(array);
                }
            }
        }
        return 0;
    } run {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            String[] array = scan.nextLine().split(" ");
            for (int i = 1; i <= T; i++) {
                if (i == 1)
                    print(array);
                else {
                    int pointer = i - 1;
                    for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    }
                    print(array);
                }
            }
        }
        return 0;
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            String[] array = scan.nextLine().split(" ");
            for (int i = 1; i <= T; i++) {
                if (i == 1)
                    print(array);
                else {
                    int pointer = i - 1;
                    for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    }
                    print(array);
                }
            }
        } scan.hasNext() scan.hasNext scan {
            int T = Integer.parseInt(scan.nextLine());
            String[] array = scan.nextLine().split(" ");
            for (int i = 1; i <= T; i++) {
                if (i == 1)
                    print(array);
                else {
                    int pointer = i - 1;
                    for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    }
                    print(array);
                }
            }
        } int T = Integer.parseInt(scan.nextLine()); T Integer.parseInt(scan.nextLine()) Integer.parseInt Integer scan.nextLine() scan.nextLine scan String[] array = scan.nextLine().split(" "); array scan.nextLine().split(" ") scan.nextLine().split scan.nextLine() scan.nextLine scan " " for (int i = 1; i <= T; i++) {
                if (i == 1)
                    print(array);
                else {
                    int pointer = i - 1;
                    for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    }
                    print(array);
                }
            } int i = 1; int i = 1; i 1 i <= T i T i++ i++ i {
                if (i == 1)
                    print(array);
                else {
                    int pointer = i - 1;
                    for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    }
                    print(array);
                }
            } {
                if (i == 1)
                    print(array);
                else {
                    int pointer = i - 1;
                    for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    }
                    print(array);
                }
            } if (i == 1)
                    print(array);
                else {
                    int pointer = i - 1;
                    for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    }
                    print(array);
                } i == 1 i 1 print(array) print array {
                    int pointer = i - 1;
                    for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    }
                    print(array);
                } int pointer = i - 1; pointer i - 1 i 1 for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    } int j = pointer - 1; int j = pointer - 1; j pointer - 1 pointer 1 j >= 0 j 0 j-- j-- j {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    } {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    } if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break; Integer.parseInt(array[pointer]) < Integer.parseInt(array[j]) Integer.parseInt(array[pointer]) Integer.parseInt Integer array[pointer] array pointer Integer.parseInt(array[j]) Integer.parseInt Integer array[j] array j {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } String temp = array[pointer]; temp array[pointer] array pointer array[pointer] = array[j] array[pointer] array pointer array[j] array j array[j] = temp array[j] array j temp pointer = j pointer j break; print(array) print array return 0; 0 String[] args args public static void main(String[] args)
    {
        run(args);
    } main {
        run(args);
    } run(args) run args String[] args args public class Main {
    static void print(Object[] array)
    {
        for(int i = 0;i<array.length;i++)
        {
            if(i==0)
                System.out.print(array[i].toString());
            else
                System.out.print(" "+array[i].toString());
        }
        System.out.println();
    }
    static int run(String[] args)
    {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            String[] array = scan.nextLine().split(" ");
            for (int i = 1; i <= T; i++) {
                if (i == 1)
                    print(array);
                else {
                    int pointer = i - 1;
                    for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    }
                    print(array);
                }
            }
        }
        return 0;
    }
    public static void main(String[] args)
    {
        run(args);
    }

} public class Main {
    static void print(Object[] array)
    {
        for(int i = 0;i<array.length;i++)
        {
            if(i==0)
                System.out.print(array[i].toString());
            else
                System.out.print(" "+array[i].toString());
        }
        System.out.println();
    }
    static int run(String[] args)
    {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            String[] array = scan.nextLine().split(" ");
            for (int i = 1; i <= T; i++) {
                if (i == 1)
                    print(array);
                else {
                    int pointer = i - 1;
                    for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    }
                    print(array);
                }
            }
        }
        return 0;
    }
    public static void main(String[] args)
    {
        run(args);
    }

} Main

import java.util.Scanner;

/**
 * Created by ??\??? on 2016/12/2.
 */
public class Main {
    static void print(Object[] array)
    {
        for(int i = 0;i<array.length;i++)
        {
            if(i==0)
                System.out.print(array[i].toString());
            else
                System.out.print(" "+array[i].toString());
        }
        System.out.println();
    }
    static int run(String[] args)
    {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            int T = Integer.parseInt(scan.nextLine());
            String[] array = scan.nextLine().split(" ");
            for (int i = 1; i <= T; i++) {
                if (i == 1)
                    print(array);
                else {
                    int pointer = i - 1;
                    for (int j = pointer - 1; j >= 0; j--) {
                        if (Integer.parseInt(array[pointer]) < Integer.parseInt(array[j])) {
                            String temp = array[pointer];
                            array[pointer] = array[j];
                            array[j] = temp;
                            pointer = j;
                        } else break;
                    }
                    print(array);
                }
            }
        }
        return 0;
    }
    public static void main(String[] args)
    {
        run(args);
    }

}