n = int(input())
A = [int(x) for x in input().split()]
print(" ".join([str(x) for x in A]))

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 -= 1
    A[j+1] = key
    print(" ".join([str(x) for x in 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()] str(x) for x in A for x in A x A for x in A str(x) str x print(" ".join([str(x) for x in A])) print " ".join([str(x) for x in A]) " ".join " " join [str(x) for x in A] 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 -= 1
    A[j+1] = key
    print(" ".join([str(x) for x in A])) 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 -= 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 -= 1 j 1 A[j+1] = key A[j+1] A j+1 j 1 key str(x) for x in A for x in A x A for x in A str(x) str x print(" ".join([str(x) for x in A])) print " ".join([str(x) for x in A]) " ".join " " join [str(x) for x in A] n = int(input()) int(input()) n j -= 1 1 j A = [int(x) for x in input().split()] [int(x) for x in input().split()] A j = i-1 i-1 j key = A[i] A[i] key
n = int(input())
A = [int(x) for x in input().split()]
print(" ".join([str(x) for x in A]))

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 -= 1
    A[j+1] = key
    print(" ".join([str(x) for x in A]))