N = input()
l = map(int, raw_input().split())
i = 1
while i < N:
    l_str = map(str,l)
    print " ".join(l_str)
    tmp = l[i]
    j = i - 1
    while j >= 0 and tmp < l[j]:
        l[j + 1] = l[j]
        j -= 1
    l[j + 1] = tmp
    i += 1
l_str = map(str,l)
print " ".join(l_str) N = input() N input() input l = map(int, raw_input().split()) l map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split i = 1 i 1 while i < N:
    l_str = map(str,l)
    print " ".join(l_str)
    tmp = l[i]
    j = i - 1
    while j >= 0 and tmp < l[j]:
        l[j + 1] = l[j]
        j -= 1
    l[j + 1] = tmp
    i += 1 i < N i N l_str = map(str,l) l_str map(str,l) map str l print " ".join(l_str) " ".join " " join l_str tmp = l[i] tmp l[i] l i j = i - 1 j i - 1 i 1 while j >= 0 and tmp < l[j]:
        l[j + 1] = l[j]
        j -= 1
     j >= 0 and tmp < l[j] j >= 0 j 0 tmp < l[j] tmp l[j] l j l[j + 1] = l[j] l[j + 1] l j + 1 j 1 l[j] l j j -= 1 j 1 l[j + 1] = tmp l[j + 1] l j + 1 j 1 tmp i += 1 i 1 l_str = map(str,l) l_str map(str,l) map str l print " ".join(l_str) " ".join " " join l_str i = 1 1 i l_str = map(str,l) map(str,l) l_str j = i - 1 i - 1 j N = input() input() N l = map(int, raw_input().split()) map(int, raw_input().split()) l j -= 1 1 j l_str = map(str,l) map(str,l) l_str tmp = l[i] l[i] tmp i += 1 1 i
N = input()
l = map(int, raw_input().split())
i = 1
while i < N:
    l_str = map(str,l)
    print " ".join(l_str)
    tmp = l[i]
    j = i - 1
    while j >= 0 and tmp < l[j]:
        l[j + 1] = l[j]
        j -= 1
    l[j + 1] = tmp
    i += 1
l_str = map(str,l)
print " ".join(l_str)