num = int(raw_input())
line = raw_input()

item_str = line.strip().split(" ")
print " ".join(item_str)
A = map(int, item_str)

for i in range(1, num):
    v = A[i]
    j = i - 1
    for j in range(j, -1, -1):
        if A[j] > v:
            A[j+1] = A[j]
            j -= 1
        else:
            break
    A[j+1] = v
    str_A = map(str, A)
    print " ".join(str_A) num = int(raw_input()) num int(raw_input()) int raw_input() raw_input line = raw_input() line raw_input() raw_input item_str = line.strip().split(" ") item_str line.strip().split(" ") line.strip().split line.strip() line.strip line strip split " " print " ".join(item_str) " ".join " " join item_str A = map(int, item_str) A map(int, item_str) map int item_str for i in range(1, num):
    v = A[i]
    j = i - 1
    for j in range(j, -1, -1):
        if A[j] > v:
            A[j+1] = A[j]
            j -= 1
        else:
            break
    A[j+1] = v
    str_A = map(str, A)
    print " ".join(str_A) i range(1, num) range 1 num v = A[i] v A[i] A i j = i - 1 j i - 1 i 1 for j in range(j, -1, -1):
        if A[j] > v:
            A[j+1] = A[j]
            j -= 1
        else:
            break
     j range(j, -1, -1) range j -1 -1 if A[j] > v:
            A[j+1] = A[j]
            j -= 1
        else:
            break
     A[j] > v A[j] A j v A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j j -= 1 j 1 break A[j+1] = v A[j+1] A j+1 j 1 v str_A = map(str, A) str_A map(str, A) map str A print " ".join(str_A) " ".join " " join str_A v = A[i] A[i] v num = int(raw_input()) int(raw_input()) num str_A = map(str, A) map(str, A) str_A line = raw_input() raw_input() line j -= 1 1 j A = map(int, item_str) map(int, item_str) A j = i - 1 i - 1 j item_str = line.strip().split(" ") line.strip().split(" ") item_str
num = int(raw_input())
line = raw_input()

item_str = line.strip().split(" ")
print " ".join(item_str)
A = map(int, item_str)

for i in range(1, num):
    v = A[i]
    j = i - 1
    for j in range(j, -1, -1):
        if A[j] > v:
            A[j+1] = A[j]
            j -= 1
        else:
            break
    A[j+1] = v
    str_A = map(str, A)
    print " ".join(str_A)