import java.util.Scanner;
import java.util.Arrays;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int size = scan.nextInt();
        int arr[] = new int[size];
        for(int i = 0; i < size; i++) arr[i] = scan.nextInt();
        for(int i = 0; i < size; i++){
            int tmp = arr[i], j = i;
            for(; 0 < j && tmp <= arr[j - 1]; j--) arr[j] = arr[j - 1];
            arr[j] = tmp;
            for(j = 0; j < size; j++)
                System.out.print((j == 0 ? "" : " ") + arr[j]);
            System.out.println();
        }
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int size = scan.nextInt();
        int arr[] = new int[size];
        for(int i = 0; i < size; i++) arr[i] = scan.nextInt();
        for(int i = 0; i < size; i++){
            int tmp = arr[i], j = i;
            for(; 0 < j && tmp <= arr[j - 1]; j--) arr[j] = arr[j - 1];
            arr[j] = tmp;
            for(j = 0; j < size; j++)
                System.out.print((j == 0 ? "" : " ") + arr[j]);
            System.out.println();
        }
    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int size = scan.nextInt();
        int arr[] = new int[size];
        for(int i = 0; i < size; i++) arr[i] = scan.nextInt();
        for(int i = 0; i < size; i++){
            int tmp = arr[i], j = i;
            for(; 0 < j && tmp <= arr[j - 1]; j--) arr[j] = arr[j - 1];
            arr[j] = tmp;
            for(j = 0; j < size; j++)
                System.out.print((j == 0 ? "" : " ") + arr[j]);
            System.out.println();
        }
    } main {
        Scanner scan = new Scanner(System.in);
        int size = scan.nextInt();
        int arr[] = new int[size];
        for(int i = 0; i < size; i++) arr[i] = scan.nextInt();
        for(int i = 0; i < size; i++){
            int tmp = arr[i], j = i;
            for(; 0 < j && tmp <= arr[j - 1]; j--) arr[j] = arr[j - 1];
            arr[j] = tmp;
            for(j = 0; j < size; j++)
                System.out.print((j == 0 ? "" : " ") + arr[j]);
            System.out.println();
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int size = scan.nextInt(); size scan.nextInt() scan.nextInt scan int arr[] = new int[size]; arr new int[size] size for(int i = 0; i < size; i++) arr[i] = scan.nextInt(); int i = 0; int i = 0; i 0 i < size i size i++ i++ i arr[i] = scan.nextInt(); arr[i] = scan.nextInt() arr[i] arr i scan.nextInt() scan.nextInt scan for(int i = 0; i < size; i++){
            int tmp = arr[i], j = i;
            for(; 0 < j && tmp <= arr[j - 1]; j--) arr[j] = arr[j - 1];
            arr[j] = tmp;
            for(j = 0; j < size; j++)
                System.out.print((j == 0 ? "" : " ") + arr[j]);
            System.out.println();
        } int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
            int tmp = arr[i], j = i;
            for(; 0 < j && tmp <= arr[j - 1]; j--) arr[j] = arr[j - 1];
            arr[j] = tmp;
            for(j = 0; j < size; j++)
                System.out.print((j == 0 ? "" : " ") + arr[j]);
            System.out.println();
        } {
            int tmp = arr[i], j = i;
            for(; 0 < j && tmp <= arr[j - 1]; j--) arr[j] = arr[j - 1];
            arr[j] = tmp;
            for(j = 0; j < size; j++)
                System.out.print((j == 0 ? "" : " ") + arr[j]);
            System.out.println();
        } int tmp = arr[i] tmp arr[i] arr i j = i; j i for(; 0 < j && tmp <= arr[j - 1]; j--) arr[j] = arr[j - 1]; ; 0 < j && tmp <= arr[j - 1] 0 < j 0 j tmp <= arr[j - 1] tmp arr[j - 1] arr j - 1 j 1 j-- j-- j arr[j] = arr[j - 1]; arr[j] = arr[j - 1] arr[j] arr j arr[j - 1] arr j - 1 j 1 arr[j] = tmp arr[j] arr j tmp for(j = 0; j < size; j++)
                System.out.print((j == 0 ? "" : " ") + arr[j]); j = 0; j = 0 j 0 j < size j size j++ j++ j System.out.print((j == 0 ? "" : " ") + arr[j]); System.out.print((j == 0 ? "" : " ") + arr[j]) System.out.print System.out System System.out (j == 0 ? "" : " ") + arr[j] (j == 0 ? "" : " ") j == 0 j 0 "" " " arr[j] arr j System.out.println() System.out.println System.out System System.out String[] args args public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int size = scan.nextInt();
        int arr[] = new int[size];
        for(int i = 0; i < size; i++) arr[i] = scan.nextInt();
        for(int i = 0; i < size; i++){
            int tmp = arr[i], j = i;
            for(; 0 < j && tmp <= arr[j - 1]; j--) arr[j] = arr[j - 1];
            arr[j] = tmp;
            for(j = 0; j < size; j++)
                System.out.print((j == 0 ? "" : " ") + arr[j]);
            System.out.println();
        }
    }
} public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int size = scan.nextInt();
        int arr[] = new int[size];
        for(int i = 0; i < size; i++) arr[i] = scan.nextInt();
        for(int i = 0; i < size; i++){
            int tmp = arr[i], j = i;
            for(; 0 < j && tmp <= arr[j - 1]; j--) arr[j] = arr[j - 1];
            arr[j] = tmp;
            for(j = 0; j < size; j++)
                System.out.print((j == 0 ? "" : " ") + arr[j]);
            System.out.println();
        }
    }
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int size = scan.nextInt();
        int arr[] = new int[size];
        for(int i = 0; i < size; i++) arr[i] = scan.nextInt();
        for(int i = 0; i < size; i++){
            int tmp = arr[i], j = i;
            for(; 0 < j && tmp <= arr[j - 1]; j--) arr[j] = arr[j - 1];
            arr[j] = tmp;
            for(j = 0; j < size; j++)
                System.out.print((j == 0 ? "" : " ") + arr[j]);
            System.out.println();
        }
    }
}