def insertionsort(x):
    x = list(map(int, x))
    for i in range(len(x)):
        for k in range(i, 0, -1):
            if x[k-1] > x[k]:
                x[k-1], x[k] = x[k], x[k-1]
        print(" ".join(map(str, x)))


if __name__ == "__main__":
    input()
    insertionsort(input().split(" ")) def insertionsort(x):
    x = list(map(int, x))
    for i in range(len(x)):
        for k in range(i, 0, -1):
            if x[k-1] > x[k]:
                x[k-1], x[k] = x[k], x[k-1]
        print(" ".join(map(str, x))) insertionsort x = list(map(int, x)) x list(map(int, x)) list map(int, x) map int x for i in range(len(x)):
        for k in range(i, 0, -1):
            if x[k-1] > x[k]:
                x[k-1], x[k] = x[k], x[k-1]
        print(" ".join(map(str, x))) i range(len(x)) range len(x) len x for k in range(i, 0, -1):
            if x[k-1] > x[k]:
                x[k-1], x[k] = x[k], x[k-1]
         k range(i, 0, -1) range i 0 -1 if x[k-1] > x[k]:
                x[k-1], x[k] = x[k], x[k-1]
         x[k-1] > x[k] x[k-1] x k-1 k 1 x[k] x k x[k-1], x[k] = x[k], x[k-1] x[k-1] x k-1 k 1 x[k] x k x[k] x k x[k-1] x k-1 k 1 print(" ".join(map(str, x))) print " ".join(map(str, x)) " ".join " " join map(str, x) map str x x x if __name__ == "__main__":
    input()
    insertionsort(input().split(" ")) __name__ == "__main__" __name__ "__main__" input() input insertionsort(input().split(" ")) insertionsort input().split(" ") ().split () input split " " def insertionsort(x):
    x = list(map(int, x))
    for i in range(len(x)):
        for k in range(i, 0, -1):
            if x[k-1] > x[k]:
                x[k-1], x[k] = x[k], x[k-1]
        print(" ".join(map(str, x))) def insertionsort(x):
    x = list(map(int, x))
    for i in range(len(x)):
        for k in range(i, 0, -1):
            if x[k-1] > x[k]:
                x[k-1], x[k] = x[k], x[k-1]
        print(" ".join(map(str, x))) insertionsort
def insertionsort(x):
    x = list(map(int, x))
    for i in range(len(x)):
        for k in range(i, 0, -1):
            if x[k-1] > x[k]:
                x[k-1], x[k] = x[k], x[k-1]
        print(" ".join(map(str, x)))


if __name__ == "__main__":
    input()
    insertionsort(input().split(" "))