n = int(input())
line = input()
arr = line.split(" ")
nums = []
for c in range(n):
    nums.append(int(arr[c]))

def trace(n_list):
    n_list_str = ""
    for num in n_list:
        n_list_str += str(num)
        n_list_str += " "
    print(n_list_str.rstrip(" "))
            
print(line)
for i in range(1, n):
    v = nums[i]
    j = i-1
    while j >= 0 and nums[j] > v:
        nums[j+1] = nums[j]
        j -= 1
    nums[j+1] = v
    trace(nums) n = int(input()) n int(input()) int input() input line = input() line input() input arr = line.split(" ") arr line.split(" ") line.split line split " " nums = [] nums [] for c in range(n):
    nums.append(int(arr[c])) c range(n) range n nums.append(int(arr[c])) nums.append nums append int(arr[c]) int arr[c] arr c def trace(n_list):
    n_list_str = ""
    for num in n_list:
        n_list_str += str(num)
        n_list_str += " "
    print(n_list_str.rstrip(" "))
             trace n_list_str = "" n_list_str "" for num in n_list:
        n_list_str += str(num)
        n_list_str += " "
     num n_list n_list_str += str(num) n_list_str str(num) str num n_list_str += " " n_list_str " " print(n_list_str.rstrip(" ")) print n_list_str.rstrip(" ") n_list_str.rstrip n_list_str rstrip " " n_list n_list print(line) print line for i in range(1, n):
    v = nums[i]
    j = i-1
    while j >= 0 and nums[j] > v:
        nums[j+1] = nums[j]
        j -= 1
    nums[j+1] = v
    trace(nums) i range(1, n) range 1 n v = nums[i] v nums[i] nums i j = i-1 j i-1 i 1 while j >= 0 and nums[j] > v:
        nums[j+1] = nums[j]
        j -= 1
     j >= 0 and nums[j] > v j >= 0 j 0 nums[j] > v nums[j] nums j v nums[j+1] = nums[j] nums[j+1] nums j+1 j 1 nums[j] nums j j -= 1 j 1 nums[j+1] = v nums[j+1] nums j+1 j 1 v trace(nums) trace nums n = int(input()) int(input()) n j -= 1 1 j nums = [] [] nums line = input() input() line def trace(n_list):
    n_list_str = ""
    for num in n_list:
        n_list_str += str(num)
        n_list_str += " "
    print(n_list_str.rstrip(" "))
             def trace(n_list):
    n_list_str = ""
    for num in n_list:
        n_list_str += str(num)
        n_list_str += " "
    print(n_list_str.rstrip(" "))
             trace j = i-1 i-1 j arr = line.split(" ") line.split(" ") arr v = nums[i] nums[i] v
n = int(input())
line = input()
arr = line.split(" ")
nums = []
for c in range(n):
    nums.append(int(arr[c]))

def trace(n_list):
    n_list_str = ""
    for num in n_list:
        n_list_str += str(num)
        n_list_str += " "
    print(n_list_str.rstrip(" "))
            
print(line)
for i in range(1, n):
    v = nums[i]
    j = i-1
    while j >= 0 and nums[j] > v:
        nums[j+1] = nums[j]
        j -= 1
    nums[j+1] = v
    trace(nums)