n=int(input())
a=[int(i) for i in input().split()]

aaa=" ".join(map(str,a))
print(aaa)

for i in range(1,n):
    key=a[i]
    j=i-1
    while j >= 0 and a[j] > key:
        a[j+1]=a[j]
        j=j-1
    a[j+1]=key
    aaa=" ".join(map(str,a))
    print(aaa) n=int(input()) n int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a=[int(i) for i in input().split()] a [int(i) for i in input().split()] aaa=" ".join(map(str,a)) aaa " ".join(map(str,a)) " ".join " " join map(str,a) map str a print(aaa) print aaa for i in range(1,n):
    key=a[i]
    j=i-1
    while j >= 0 and a[j] > key:
        a[j+1]=a[j]
        j=j-1
    a[j+1]=key
    aaa=" ".join(map(str,a))
    print(aaa) i range(1,n) range 1 n key=a[i] key a[i] a i j=i-1 j i-1 i 1 while j >= 0 and a[j] > key:
        a[j+1]=a[j]
        j=j-1
     j >= 0 and a[j] > key j >= 0 j 0 a[j] > key a[j] a j key a[j+1]=a[j] a[j+1] a j+1 j 1 a[j] a j j=j-1 j j-1 j 1 a[j+1]=key a[j+1] a j+1 j 1 key aaa=" ".join(map(str,a)) aaa " ".join(map(str,a)) " ".join " " join map(str,a) map str a print(aaa) print aaa aaa=" ".join(map(str,a)) " ".join(map(str,a)) aaa a=[int(i) for i in input().split()] [int(i) for i in input().split()] a j=i-1 i-1 j aaa=" ".join(map(str,a)) " ".join(map(str,a)) aaa n=int(input()) int(input()) n j=j-1 j-1 j key=a[i] a[i] key
n=int(input())
a=[int(i) for i in input().split()]

aaa=" ".join(map(str,a))
print(aaa)

for i in range(1,n):
    key=a[i]
    j=i-1
    while j >= 0 and a[j] > key:
        a[j+1]=a[j]
        j=j-1
    a[j+1]=key
    aaa=" ".join(map(str,a))
    print(aaa)