N = int(input())
A = list(map(int, input().split()))
print(" ".join(map(str,A)))
for i in range(1,N):
    tmp = A[i]
    j = i-1
    while j >= 0 and A[j] > tmp:
        A[j+1] = A[j]
        j += -1
    A[j+1] = tmp
    print(" ".join(map(str,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 print(" ".join(map(str,A))) print " ".join(map(str,A)) " ".join " " join map(str,A) map str A for i in range(1,N):
    tmp = A[i]
    j = i-1
    while j >= 0 and A[j] > tmp:
        A[j+1] = A[j]
        j += -1
    A[j+1] = tmp
    print(" ".join(map(str,A))) i range(1,N) range 1 N tmp = A[i] tmp A[i] A i j = i-1 j i-1 i 1 while j >= 0 and A[j] > tmp:
        A[j+1] = A[j]
        j += -1
     j >= 0 and A[j] > tmp j >= 0 j 0 A[j] > tmp A[j] A j tmp A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j j += -1 j -1 A[j+1] = tmp A[j+1] A j+1 j 1 tmp print(" ".join(map(str,A))) print " ".join(map(str,A)) " ".join " " join map(str,A) map str A N = int(input()) int(input()) N j += -1 -1 j j = i-1 i-1 j A = list(map(int, input().split())) list(map(int, input().split())) A tmp = A[i] A[i] tmp
N = int(input())
A = list(map(int, input().split()))
print(" ".join(map(str,A)))
for i in range(1,N):
    tmp = A[i]
    j = i-1
    while j >= 0 and A[j] > tmp:
        A[j+1] = A[j]
        j += -1
    A[j+1] = tmp
    print(" ".join(map(str,A)))
