NN=raw_input()
N=raw_input()
N = [int(i) for i in N.split()]
print ' '.join([str(k) for k in N])

for i in range(1,int(NN)):
    key = N[i]
    j = i - 1
    while (j >= 0) and (N[j] > key):
        N[j+1] = N[j]
        j=j-1
    N[j+1] = key
    print ' '.join([str(k) for k in N]) NN=raw_input() NN raw_input() raw_input N=raw_input() N raw_input() raw_input int(i) for i in N.split() for i in N.split() i N.split() N.split N split for i in N.split() int(i) int i N = [int(i) for i in N.split()] N [int(i) for i in N.split()] print str(k) for k in N for k in N k N for k in N str(k) str k ' '.join([str(k) for k in N]) ' '.join ' ' join [str(k) for k in N] for i in range(1,int(NN)):
    key = N[i]
    j = i - 1
    while (j >= 0) and (N[j] > key):
        N[j+1] = N[j]
        j=j-1
    N[j+1] = key
    print ' '.join([str(k) for k in N]) i range(1,int(NN)) range 1 int(NN) int NN key = N[i] key N[i] N i j = i - 1 j i - 1 i 1 while (j >= 0) and (N[j] > key):
        N[j+1] = N[j]
        j=j-1
     (j >= 0) and (N[j] > key) j >= 0 j 0 N[j] > key N[j] N j key N[j+1] = N[j] N[j+1] N j+1 j 1 N[j] N j j=j-1 j j-1 j 1 N[j+1] = key N[j+1] N j+1 j 1 key print str(k) for k in N for k in N k N for k in N str(k) str k ' '.join([str(k) for k in N]) ' '.join ' ' join [str(k) for k in N] N=raw_input() raw_input() N key = N[i] N[i] key N = [int(i) for i in N.split()] [int(i) for i in N.split()] N j=j-1 j-1 j j = i - 1 i - 1 j NN=raw_input() raw_input() NN
NN=raw_input()
N=raw_input()
N = [int(i) for i in N.split()]
print ' '.join([str(k) for k in N])

for i in range(1,int(NN)):
    key = N[i]
    j = i - 1
    while (j >= 0) and (N[j] > key):
        N[j+1] = N[j]
        j=j-1
    N[j+1] = key
    print ' '.join([str(k) for k in N])