N = int(input())
a = [int(x) for x in input().split()]

for i in range(0, len(a)) :
    repl = i
    cur_num = a[i]
    
    # fetch idx to replace
    for j in range(i, -1, -1) :
        if a[j] >= a[i] :
            repl = j
    
    # shift
    for k in range(i, repl - 1, -1) :
        a[k] = a[k - 1]
    
    a[repl] = cur_num
    
    print(" ".join(map(str, a)))
 N = int(input()) N int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a = [int(x) for x in input().split()] a [int(x) for x in input().split()] for i in range(0, len(a)) :
    repl = i
    cur_num = a[i]
    
    # fetch idx to replace
    for j in range(i, -1, -1) :
        if a[j] >= a[i] :
            repl = j
    
    # shift
    for k in range(i, repl - 1, -1) :
        a[k] = a[k - 1]
    
    a[repl] = cur_num
    
    print(" ".join(map(str, a))) i range(0, len(a)) range 0 len(a) len a repl = i repl i cur_num = a[i] cur_num a[i] a i for j in range(i, -1, -1) :
        if a[j] >= a[i] :
            repl = j
    
    # shift
     j range(i, -1, -1) range i -1 -1 if a[j] >= a[i] :
            repl = j
    
    # shift
     a[j] >= a[i] a[j] a j a[i] a i repl = j repl j for k in range(i, repl - 1, -1) :
        a[k] = a[k - 1]
    
     k range(i, repl - 1, -1) range i repl - 1 repl 1 -1 a[k] = a[k - 1] a[k] a k a[k - 1] a k - 1 k 1 a[repl] = cur_num a[repl] a repl cur_num print(" ".join(map(str, a))) print " ".join(map(str, a)) " ".join " " join map(str, a) map str a cur_num = a[i] a[i] cur_num repl = i i repl repl = j j repl a = [int(x) for x in input().split()] [int(x) for x in input().split()] a N = int(input()) int(input()) N
N = int(input())
a = [int(x) for x in input().split()]

for i in range(0, len(a)) :
    repl = i
    cur_num = a[i]
    
    # fetch idx to replace
    for j in range(i, -1, -1) :
        if a[j] >= a[i] :
            repl = j
    
    # shift
    for k in range(i, repl - 1, -1) :
        a[k] = a[k - 1]
    
    a[repl] = cur_num
    
    print(" ".join(map(str, a)))

