N = int(raw_input())
num_list = map(int, raw_input().split())

print " ".join(map(str,num_list))
for i in range(1, N):
    v = num_list[i]
    j = i - 1
    while j >= 0 and num_list[j] > v:
       num_list[j+1] = num_list[j]
       j-=1
    num_list[j+1] = v
    print " ".join(map(str,num_list)) N = int(raw_input()) N int(raw_input()) int raw_input() raw_input num_list = map(int, raw_input().split()) num_list map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split print " ".join(map(str,num_list)) " ".join " " join map(str,num_list) map str num_list for i in range(1, N):
    v = num_list[i]
    j = i - 1
    while j >= 0 and num_list[j] > v:
       num_list[j+1] = num_list[j]
       j-=1
    num_list[j+1] = v
    print " ".join(map(str,num_list)) i range(1, N) range 1 N v = num_list[i] v num_list[i] num_list i j = i - 1 j i - 1 i 1 while j >= 0 and num_list[j] > v:
       num_list[j+1] = num_list[j]
       j-=1
     j >= 0 and num_list[j] > v j >= 0 j 0 num_list[j] > v num_list[j] num_list j v num_list[j+1] = num_list[j] num_list[j+1] num_list j+1 j 1 num_list[j] num_list j j-=1 j 1 num_list[j+1] = v num_list[j+1] num_list j+1 j 1 v print " ".join(map(str,num_list)) " ".join " " join map(str,num_list) map str num_list num_list = map(int, raw_input().split()) map(int, raw_input().split()) num_list N = int(raw_input()) int(raw_input()) N j = i - 1 i - 1 j j-=1 1 j v = num_list[i] num_list[i] v
N = int(raw_input())
num_list = map(int, raw_input().split())

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