n = int(input())

array = input().split()

intarr = [int(x) for x in array]
for x in intarr:
    if x == intarr[-1]:
        print(x)
    else:
        print(x,end=' ')


for c in range(1,n):
    v = intarr[c]
    j = c-1
    while j>=0 and intarr[j]>v:
        intarr[j+1] = intarr[j]
        j -= 1
    intarr[j+1] = v
    for x in intarr:
        if x == intarr[-1]:
            print(x)
        else:
            print(x, end=' ') n = int(input()) n int(input()) int input() input array = input().split() array input().split() ().split () input split int(x) for x in array for x in array x array for x in array int(x) int x intarr = [int(x) for x in array] intarr [int(x) for x in array] for x in intarr:
    if x == intarr[-1]:
        print(x)
    else:
        print(x,end=' ') x intarr if x == intarr[-1]:
        print(x)
    else:
        print(x,end=' ') x == intarr[-1] x intarr[-1] intarr -1 print(x) print x print(x,end=' ') print x end=' ' end ' ' for c in range(1,n):
    v = intarr[c]
    j = c-1
    while j>=0 and intarr[j]>v:
        intarr[j+1] = intarr[j]
        j -= 1
    intarr[j+1] = v
    for x in intarr:
        if x == intarr[-1]:
            print(x)
        else:
            print(x, end=' ') c range(1,n) range 1 n v = intarr[c] v intarr[c] intarr c j = c-1 j c-1 c 1 while j>=0 and intarr[j]>v:
        intarr[j+1] = intarr[j]
        j -= 1
     j>=0 and intarr[j]>v j>=0 j 0 intarr[j]>v intarr[j] intarr j v intarr[j+1] = intarr[j] intarr[j+1] intarr j+1 j 1 intarr[j] intarr j j -= 1 j 1 intarr[j+1] = v intarr[j+1] intarr j+1 j 1 v for x in intarr:
        if x == intarr[-1]:
            print(x)
        else:
            print(x, end=' ') x intarr if x == intarr[-1]:
            print(x)
        else:
            print(x, end=' ') x == intarr[-1] x intarr[-1] intarr -1 print(x) print x print(x, end=' ') print x end=' ' end ' ' v = intarr[c] intarr[c] v n = int(input()) int(input()) n j -= 1 1 j intarr = [int(x) for x in array] [int(x) for x in array] intarr array = input().split() input().split() array j = c-1 c-1 j
n = int(input())

array = input().split()

intarr = [int(x) for x in array]
for x in intarr:
    if x == intarr[-1]:
        print(x)
    else:
        print(x,end=' ')


for c in range(1,n):
    v = intarr[c]
    j = c-1
    while j>=0 and intarr[j]>v:
        intarr[j+1] = intarr[j]
        j -= 1
    intarr[j+1] = v
    for x in intarr:
        if x == intarr[-1]:
            print(x)
        else:
            print(x, end=' ')