count = int(input());
data = [int(n) for n in input().split(" ")];

def insert_sort(data):
    show(data);
    for i in range(1, len(data)):
        n = data[i];
        j = i - 1;
        while j >= 0 and data[j] > n:
            data[j + 1] = data[j];
            j -= 1;
        data[j + 1] = n;
        show(data);

def show(data):
    print(" ".join(str(n) for n in data));

insert_sort(data); count = int(input()) count int(input()) int input() input int(n) for n in input().split(" ") for n in input().split(" ") n input().split(" ") ().split () input split " " for n in input().split(" ") int(n) int n data = [int(n) for n in input().split(" ")] data [int(n) for n in input().split(" ")] def insert_sort(data):
    show(data);
    for i in range(1, len(data)):
        n = data[i];
        j = i - 1;
        while j >= 0 and data[j] > n:
            data[j + 1] = data[j];
            j -= 1;
        data[j + 1] = n;
        show(data); insert_sort show(data) show data for i in range(1, len(data)):
        n = data[i];
        j = i - 1;
        while j >= 0 and data[j] > n:
            data[j + 1] = data[j];
            j -= 1;
        data[j + 1] = n;
        show(data); i range(1, len(data)) range 1 len(data) len data n = data[i] n data[i] data i j = i - 1 j i - 1 i 1 while j >= 0 and data[j] > n:
            data[j + 1] = data[j];
            j -= 1;
         j >= 0 and data[j] > n j >= 0 j 0 data[j] > n data[j] data j n data[j + 1] = data[j] data[j + 1] data j + 1 j 1 data[j] data j j -= 1 j 1 data[j + 1] = n data[j + 1] data j + 1 j 1 n show(data) show data data data def show(data):
    print(" ".join(str(n) for n in data)); show print(" ".join(str(n) for n in data)) print " ".join(str(n) for n in data) " ".join " " join str(n) str n data data insert_sort(data) insert_sort data count = int(input()) int(input()) count def insert_sort(data):
    show(data);
    for i in range(1, len(data)):
        n = data[i];
        j = i - 1;
        while j >= 0 and data[j] > n:
            data[j + 1] = data[j];
            j -= 1;
        data[j + 1] = n;
        show(data); def insert_sort(data):
    show(data);
    for i in range(1, len(data)):
        n = data[i];
        j = i - 1;
        while j >= 0 and data[j] > n:
            data[j + 1] = data[j];
            j -= 1;
        data[j + 1] = n;
        show(data); insert_sort data = [int(n) for n in input().split(" ")] [int(n) for n in input().split(" ")] data def show(data):
    print(" ".join(str(n) for n in data)); def show(data):
    print(" ".join(str(n) for n in data)); show
count = int(input());
data = [int(n) for n in input().split(" ")];

def insert_sort(data):
    show(data);
    for i in range(1, len(data)):
        n = data[i];
        j = i - 1;
        while j >= 0 and data[j] > n:
            data[j + 1] = data[j];
            j -= 1;
        data[j + 1] = n;
        show(data);

def show(data):
    print(" ".join(str(n) for n in data));

insert_sort(data);
