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

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

for i in range(n):
    j = i
    while j >= 1 and a[j-1] > a[j]:
        a[j-1], a[j] = a[j], a[j-1]
        j -= 1
    print(*a)
