n = int(input())
a = [int(x) for x in input().split()]
print(*a)
for i in range(1, n):
    k, j = a[i], i-1
    while j >= 0 and a[j] > k:
        a[j+1], j = a[j], j-1
    a[j+1] = k
    print(*a) n = int(input()) n int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a = [int(x) for x in input().split()] a [int(x) for x in input().split()] print(*a) print *a a for i in range(1, n):
    k, j = a[i], i-1
    while j >= 0 and a[j] > k:
        a[j+1], j = a[j], j-1
    a[j+1] = k
    print(*a) i range(1, n) range 1 n k, j = a[i], i-1 k a[i] a i j i-1 i 1 while j >= 0 and a[j] > k:
        a[j+1], j = a[j], j-1
     j >= 0 and a[j] > k j >= 0 j 0 a[j] > k a[j] a j k a[j+1], j = a[j], j-1 a[j+1] a j+1 j 1 a[j] a j j j-1 j 1 a[j+1] = k a[j+1] a j+1 j 1 k print(*a) print *a a n = int(input()) int(input()) n a = [int(x) for x in input().split()] [int(x) for x in input().split()] a j = a[j], j-1 j-1 j k, j = a[i], i-1 a[i] k j = a[i], i-1 i-1 j
n = int(input())
a = [int(x) for x in input().split()]
print(*a)
for i in range(1, n):
    k, j = a[i], i-1
    while j >= 0 and a[j] > k:
        a[j+1], j = a[j], j-1
    a[j+1] = k
    print(*a)