# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_A
import sys

nums_len = int(sys.stdin.readline())
nums_str = sys.stdin.readline().split(' ')
nums = map(int, nums_str)

print ' '.join(map(str, nums))
for i in range(1, nums_len):
    for j in reversed(range(1, i + 1)):
        if nums[j] < nums[j - 1]:
            v = nums[j]
            nums[j] = nums[j - 1]
            nums[j - 1] = v
    print ' '.join(map(str, nums)) import sys sys nums_len = int(sys.stdin.readline()) nums_len int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline nums_str = sys.stdin.readline().split(' ') nums_str sys.stdin.readline().split(' ') sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split ' ' nums = map(int, nums_str) nums map(int, nums_str) map int nums_str print ' '.join(map(str, nums)) ' '.join ' ' join map(str, nums) map str nums for i in range(1, nums_len):
    for j in reversed(range(1, i + 1)):
        if nums[j] < nums[j - 1]:
            v = nums[j]
            nums[j] = nums[j - 1]
            nums[j - 1] = v
    print ' '.join(map(str, nums)) i range(1, nums_len) range 1 nums_len for j in reversed(range(1, i + 1)):
        if nums[j] < nums[j - 1]:
            v = nums[j]
            nums[j] = nums[j - 1]
            nums[j - 1] = v
     j reversed(range(1, i + 1)) reversed range(1, i + 1) range 1 i + 1 i 1 if nums[j] < nums[j - 1]:
            v = nums[j]
            nums[j] = nums[j - 1]
            nums[j - 1] = v
     nums[j] < nums[j - 1] nums[j] nums j nums[j - 1] nums j - 1 j 1 v = nums[j] v nums[j] nums j nums[j] = nums[j - 1] nums[j] nums j nums[j - 1] nums j - 1 j 1 nums[j - 1] = v nums[j - 1] nums j - 1 j 1 v print ' '.join(map(str, nums)) ' '.join ' ' join map(str, nums) map str nums nums = map(int, nums_str) map(int, nums_str) nums nums_len = int(sys.stdin.readline()) int(sys.stdin.readline()) nums_len nums_str = sys.stdin.readline().split(' ') sys.stdin.readline().split(' ') nums_str v = nums[j] nums[j] v
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_A
import sys

nums_len = int(sys.stdin.readline())
nums_str = sys.stdin.readline().split(' ')
nums = map(int, nums_str)

print ' '.join(map(str, nums))
for i in range(1, nums_len):
    for j in reversed(range(1, i + 1)):
        if nums[j] < nums[j - 1]:
            v = nums[j]
            nums[j] = nums[j - 1]
            nums[j - 1] = v
    print ' '.join(map(str, nums))