n = int(input())
a = [int(i) for i in input().split()]
print(" ".join([str(i) for i in a]))

for i in range(1, n):
    j = i
    while a[j - 1] > a[j] and j > 0:
        a[j], a[j - 1] = a[j - 1], a[j]
        j -= 1
    print(" ".join([str(i) for i in a]))
 n = int(input()) n int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a = [int(i) for i in input().split()] a [int(i) for i in input().split()] str(i) for i in a for i in a i a for i in a str(i) str i print(" ".join([str(i) for i in a])) print " ".join([str(i) for i in a]) " ".join " " join [str(i) for i in a] for i in range(1, n):
    j = i
    while a[j - 1] > a[j] and j > 0:
        a[j], a[j - 1] = a[j - 1], a[j]
        j -= 1
    print(" ".join([str(i) for i in a])) i range(1, n) range 1 n j = i j i while a[j - 1] > a[j] and j > 0:
        a[j], a[j - 1] = a[j - 1], a[j]
        j -= 1
     a[j - 1] > a[j] and j > 0 a[j - 1] > a[j] a[j - 1] a j - 1 j 1 a[j] a j j > 0 j 0 a[j], a[j - 1] = a[j - 1], a[j] a[j] a j a[j - 1] a j - 1 j 1 a[j - 1] a j - 1 j 1 a[j] a j j -= 1 j 1 str(i) for i in a for i in a i a for i in a str(i) str i print(" ".join([str(i) for i in a])) print " ".join([str(i) for i in a]) " ".join " " join [str(i) for i in a] n = int(input()) int(input()) n j = i i j a = [int(i) for i in input().split()] [int(i) for i in input().split()] a j -= 1 1 j
n = int(input())
a = [int(i) for i in input().split()]
print(" ".join([str(i) for i in a]))

for i in range(1, n):
    j = i
    while a[j - 1] > a[j] and j > 0:
        a[j], a[j - 1] = a[j - 1], a[j]
        j -= 1
    print(" ".join([str(i) for i in a]))

