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

    
print(" ".join(map(str, num)))
for i in range(len(num)-1):
    key = num[i+1]
    j = i 
    while j >= 0 and num[j] > key:
        num[j+1] = num[j]
        j -= 1
    num[j+1] = key
    print(" ".join(map(str, num))) n = int(input()) n int(input()) int input() input num = list(map(int, input().split())) num list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split print(" ".join(map(str, num))) print " ".join(map(str, num)) " ".join " " join map(str, num) map str num for i in range(len(num)-1):
    key = num[i+1]
    j = i 
    while j >= 0 and num[j] > key:
        num[j+1] = num[j]
        j -= 1
    num[j+1] = key
    print(" ".join(map(str, num))) i range(len(num)-1) range len(num)-1 len(num) len num 1 key = num[i+1] key num[i+1] num i+1 i 1 j = i j i while j >= 0 and num[j] > key:
        num[j+1] = num[j]
        j -= 1
     j >= 0 and num[j] > key j >= 0 j 0 num[j] > key num[j] num j key num[j+1] = num[j] num[j+1] num j+1 j 1 num[j] num j j -= 1 j 1 num[j+1] = key num[j+1] num j+1 j 1 key print(" ".join(map(str, num))) print " ".join(map(str, num)) " ".join " " join map(str, num) map str num num = list(map(int, input().split())) list(map(int, input().split())) num j -= 1 1 j n = int(input()) int(input()) n key = num[i+1] num[i+1] key j = i i j
n = int(input())
num = list(map(int, input().split()))

    
print(" ".join(map(str, num)))
for i in range(len(num)-1):
    key = num[i+1]
    j = i 
    while j >= 0 and num[j] > key:
        num[j+1] = num[j]
        j -= 1
    num[j+1] = key
    print(" ".join(map(str, num)))