num = raw_input()
num_list = raw_input()
num_list = num_list.split()
print " ".join(num_list)

 
for i in range(1, len(num_list)):
        num_list = map(int, num_list)
        temp = num_list[i]
        j = i - 1
        while (j >= 0 and num_list[j] > temp):
                num_list[j+1] = num_list[j]
                j -= 1
        num_list[j+1] = temp
        num_list = map(str, num_list)
        print " ".join(num_list) num = raw_input() num raw_input() raw_input num_list = raw_input() num_list raw_input() raw_input num_list = num_list.split() num_list num_list.split() num_list.split num_list split print " ".join(num_list) " ".join " " join num_list for i in range(1, len(num_list)):
        num_list = map(int, num_list)
        temp = num_list[i]
        j = i - 1
        while (j >= 0 and num_list[j] > temp):
                num_list[j+1] = num_list[j]
                j -= 1
        num_list[j+1] = temp
        num_list = map(str, num_list)
        print " ".join(num_list) i range(1, len(num_list)) range 1 len(num_list) len num_list num_list = map(int, num_list) num_list map(int, num_list) map int num_list temp = num_list[i] temp num_list[i] num_list i j = i - 1 j i - 1 i 1 while (j >= 0 and num_list[j] > temp):
                num_list[j+1] = num_list[j]
                j -= 1
         j >= 0 and num_list[j] > temp j >= 0 j 0 num_list[j] > temp num_list[j] num_list j temp 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] = temp num_list[j+1] num_list j+1 j 1 temp num_list = map(str, num_list) num_list map(str, num_list) map str num_list print " ".join(num_list) " ".join " " join num_list num_list = map(str, num_list) map(str, num_list) num_list j = i - 1 i - 1 j num = raw_input() raw_input() num temp = num_list[i] num_list[i] temp j -= 1 1 j num_list = num_list.split() num_list.split() num_list num_list = map(int, num_list) map(int, num_list) num_list num_list = raw_input() raw_input() num_list
num = raw_input()
num_list = raw_input()
num_list = num_list.split()
print " ".join(num_list)

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