#!/usr/bin/env python
N = raw_input()
A =raw_input().split()
print ' '.join(map(str, A)) 
A = map(int, A)

for i in range(1,len(A)):
    v = A[i]
    j = i - 1 
    while j >= 0 and A[j] > v:
        A[j + 1] =A[j]
        j = j - 1 
    A[j+1] = v 
    print ' '.join(map(str,A)) N = raw_input() N raw_input() raw_input A =raw_input().split() A raw_input().split() ().split () raw_input split print ' '.join(map(str, A)) ' '.join ' ' join map(str, A) map str A A = map(int, A) A map(int, A) map int A for i in range(1,len(A)):
    v = A[i]
    j = i - 1 
    while j >= 0 and A[j] > v:
        A[j + 1] =A[j]
        j = j - 1 
    A[j+1] = v 
    print ' '.join(map(str,A)) i range(1,len(A)) range 1 len(A) len A v = A[i] v A[i] A i j = i - 1 j i - 1 i 1 while j >= 0 and A[j] > v:
        A[j + 1] =A[j]
        j = j - 1 
     j >= 0 and A[j] > v j >= 0 j 0 A[j] > v A[j] A j v A[j + 1] =A[j] A[j + 1] A j + 1 j 1 A[j] A j j = j - 1 j j - 1 j 1 A[j+1] = v A[j+1] A j+1 j 1 v print ' '.join(map(str,A)) ' '.join ' ' join map(str,A) map str A v = A[i] A[i] v A = map(int, A) map(int, A) A N = raw_input() raw_input() N j = j - 1 j - 1 j A =raw_input().split() raw_input().split() A j = i - 1 i - 1 j
#!/usr/bin/env python
N = raw_input()
A =raw_input().split()
print ' '.join(map(str, A)) 
A = map(int, A)

for i in range(1,len(A)):
    v = A[i]
    j = i - 1 
    while j >= 0 and A[j] > v:
        A[j + 1] =A[j]
        j = j - 1 
    A[j+1] = v 
    print ' '.join(map(str,A))