def main():
    N = int(input())
    values = list(map(int,input().split()))
    for i in range(1,N):
        print(" ".join(map(str,values)))
        v = values[i]
        j = i - 1
        while 0 <= j and v < values[j]:
            values[j+1] = values[j]
            j -= 1
        values[j+1] = v
    print(" ".join(map(str, values)))


if __name__ == "__main__":
    import os
    import sys
    if len(sys.argv) > 1:
        if sys.argv[1] == "-d":
            fd = os.open("input.txt", os.O_RDONLY)
            os.dup2(fd, sys.stdin.fileno())
            main()
    else:
        main() def main():
    N = int(input())
    values = list(map(int,input().split()))
    for i in range(1,N):
        print(" ".join(map(str,values)))
        v = values[i]
        j = i - 1
        while 0 <= j and v < values[j]:
            values[j+1] = values[j]
            j -= 1
        values[j+1] = v
    print(" ".join(map(str, values))) main N = int(input()) N int(input()) int input() input values = list(map(int,input().split())) values list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split for i in range(1,N):
        print(" ".join(map(str,values)))
        v = values[i]
        j = i - 1
        while 0 <= j and v < values[j]:
            values[j+1] = values[j]
            j -= 1
        values[j+1] = v
     i range(1,N) range 1 N print(" ".join(map(str,values))) print " ".join(map(str,values)) " ".join " " join map(str,values) map str values v = values[i] v values[i] values i j = i - 1 j i - 1 i 1 while 0 <= j and v < values[j]:
            values[j+1] = values[j]
            j -= 1
         0 <= j and v < values[j] 0 <= j 0 j v < values[j] v values[j] values j values[j+1] = values[j] values[j+1] values j+1 j 1 values[j] values j j -= 1 j 1 values[j+1] = v values[j+1] values j+1 j 1 v print(" ".join(map(str, values))) print " ".join(map(str, values)) " ".join " " join map(str, values) map str values if __name__ == "__main__":
    import os
    import sys
    if len(sys.argv) > 1:
        if sys.argv[1] == "-d":
            fd = os.open("input.txt", os.O_RDONLY)
            os.dup2(fd, sys.stdin.fileno())
            main()
    else:
        main() __name__ == "__main__" __name__ "__main__" import os os import sys sys if len(sys.argv) > 1:
        if sys.argv[1] == "-d":
            fd = os.open("input.txt", os.O_RDONLY)
            os.dup2(fd, sys.stdin.fileno())
            main()
    else:
        main() len(sys.argv) > 1 len(sys.argv) len sys.argv sys argv 1 if sys.argv[1] == "-d":
            fd = os.open("input.txt", os.O_RDONLY)
            os.dup2(fd, sys.stdin.fileno())
            main()
     sys.argv[1] == "-d" sys.argv[1] sys.argv sys argv 1 "-d" fd = os.open("input.txt", os.O_RDONLY) fd os.open("input.txt", os.O_RDONLY) os.open os open "input.txt" os.O_RDONLY os O_RDONLY os.dup2(fd, sys.stdin.fileno()) os.dup2 os dup2 fd sys.stdin.fileno() sys.stdin.fileno sys.stdin sys stdin fileno main() main main() main def main():
    N = int(input())
    values = list(map(int,input().split()))
    for i in range(1,N):
        print(" ".join(map(str,values)))
        v = values[i]
        j = i - 1
        while 0 <= j and v < values[j]:
            values[j+1] = values[j]
            j -= 1
        values[j+1] = v
    print(" ".join(map(str, values))) def main():
    N = int(input())
    values = list(map(int,input().split()))
    for i in range(1,N):
        print(" ".join(map(str,values)))
        v = values[i]
        j = i - 1
        while 0 <= j and v < values[j]:
            values[j+1] = values[j]
            j -= 1
        values[j+1] = v
    print(" ".join(map(str, values))) main fd = os.open("input.txt", os.O_RDONLY) os.open("input.txt", os.O_RDONLY) fd
def main():
    N = int(input())
    values = list(map(int,input().split()))
    for i in range(1,N):
        print(" ".join(map(str,values)))
        v = values[i]
        j = i - 1
        while 0 <= j and v < values[j]:
            values[j+1] = values[j]
            j -= 1
        values[j+1] = v
    print(" ".join(map(str, values)))


if __name__ == "__main__":
    import os
    import sys
    if len(sys.argv) > 1:
        if sys.argv[1] == "-d":
            fd = os.open("input.txt", os.O_RDONLY)
            os.dup2(fd, sys.stdin.fileno())
            main()
    else:
        main()