N = int(input())
A = [int(x) for x in input().split()]
print(*A)
for i in range(1, len(A)):
    key = A[i]
    j = i-1
    while j >= 0 and A[j] > key:
        A[j+1] = A[j]
        j += -1
        A[j+1] = key
    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, len(A)):
    key = A[i]
    j = i-1
    while j >= 0 and A[j] > key:
        A[j+1] = A[j]
        j += -1
        A[j+1] = key
    print(*A) i range(1, len(A)) range 1 len(A) len A 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 += -1
        A[j+1] = key
     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 += -1 j -1 A[j+1] = key A[j+1] A j+1 j 1 key print(*A) print *A A key = A[i] A[i] key A = [int(x) for x in input().split()] [int(x) for x in input().split()] A j = i-1 i-1 j N = int(input()) int(input()) N j += -1 -1 j
N = int(input())
A = [int(x) for x in input().split()]
print(*A)
for i in range(1, len(A)):
    key = A[i]
    j = i-1
    while j >= 0 and A[j] > key:
        A[j+1] = A[j]
        j += -1
        A[j+1] = key
    print(*A)