n = raw_input()
A = map(int, raw_input().split())
for i in range(0, len(A)):
        if i == len(A)-1:
            print A[i]
        else:
            print A[i],
            
for i in range(1, len(A)):
    j = i - 1
    tmp = A[i]
    while A[j] > tmp and j >= 0:
        tmp2 = A[j]
        A[j] = tmp
        A[j+1] = tmp2
        j -= 1
        
    for i in range(0, len(A)):
        if i == len(A)-1:
            print A[i]
        else:
            print A[i], n = raw_input() n raw_input() raw_input A = map(int, raw_input().split()) A map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split for i in range(0, len(A)):
        if i == len(A)-1:
            print A[i]
        else:
            print A[i],
             i range(0, len(A)) range 0 len(A) len A if i == len(A)-1:
            print A[i]
        else:
            print A[i],
             i == len(A)-1 i len(A)-1 len(A) len A 1 print A[i] A i print A[i] A i for i in range(1, len(A)):
    j = i - 1
    tmp = A[i]
    while A[j] > tmp and j >= 0:
        tmp2 = A[j]
        A[j] = tmp
        A[j+1] = tmp2
        j -= 1
        
    for i in range(0, len(A)):
        if i == len(A)-1:
            print A[i]
        else:
            print A[i], i range(1, len(A)) range 1 len(A) len A j = i - 1 j i - 1 i 1 tmp = A[i] tmp A[i] A i while A[j] > tmp and j >= 0:
        tmp2 = A[j]
        A[j] = tmp
        A[j+1] = tmp2
        j -= 1
        
     A[j] > tmp and j >= 0 A[j] > tmp A[j] A j tmp j >= 0 j 0 tmp2 = A[j] tmp2 A[j] A j A[j] = tmp A[j] A j tmp A[j+1] = tmp2 A[j+1] A j+1 j 1 tmp2 j -= 1 j 1 for i in range(0, len(A)):
        if i == len(A)-1:
            print A[i]
        else:
            print A[i], i range(0, len(A)) range 0 len(A) len A if i == len(A)-1:
            print A[i]
        else:
            print A[i], i == len(A)-1 i len(A)-1 len(A) len A 1 print A[i] A i print A[i] A i A = map(int, raw_input().split()) map(int, raw_input().split()) A n = raw_input() raw_input() n j = i - 1 i - 1 j tmp = A[i] A[i] tmp j -= 1 1 j tmp2 = A[j] A[j] tmp2
n = raw_input()
A = map(int, raw_input().split())
for i in range(0, len(A)):
        if i == len(A)-1:
            print A[i]
        else:
            print A[i],
            
for i in range(1, len(A)):
    j = i - 1
    tmp = A[i]
    while A[j] > tmp and j >= 0:
        tmp2 = A[j]
        A[j] = tmp
        A[j+1] = tmp2
        j -= 1
        
    for i in range(0, len(A)):
        if i == len(A)-1:
            print A[i]
        else:
            print A[i],