n = int(input())
a = list(map(int,input().split()))

print(' '.join(map(str,a)))
for i in range(1,n):
    v = a[i]
    j = i - 1
    while j >= 0 and a[j] > v:
        a[j+1] = a[j]
        j -= 1
    a[j+1] = v
    ans = ' '.join(map(str,a))
    print(ans)
 n = int(input()) n int(input()) int input() input a = list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split print(' '.join(map(str,a))) print ' '.join(map(str,a)) ' '.join ' ' join map(str,a) map str a for i in range(1,n):
    v = a[i]
    j = i - 1
    while j >= 0 and a[j] > v:
        a[j+1] = a[j]
        j -= 1
    a[j+1] = v
    ans = ' '.join(map(str,a))
    print(ans) i range(1,n) range 1 n v = a[i] v a[i] a i j = i - 1 j i - 1 i 1 while j >= 0 and a[j] > v:
        a[j+1] = a[j]
        j -= 1
     j >= 0 and a[j] > v j >= 0 j 0 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 a[j+1] = v a[j+1] a j+1 j 1 v ans = ' '.join(map(str,a)) ans ' '.join(map(str,a)) ' '.join ' ' join map(str,a) map str a print(ans) print ans j = i - 1 i - 1 j ans = ' '.join(map(str,a)) ' '.join(map(str,a)) ans v = a[i] a[i] v a = list(map(int,input().split())) list(map(int,input().split())) a j -= 1 1 j n = int(input()) int(input()) n
n = int(input())
a = list(map(int,input().split()))

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

