from __future__ import division, print_function, unicode_literals
from future_builtins import *

N = int(raw_input())
A = list(map(int, raw_input().split()))

print(" ".join(map(str, A)))
for i in xrange(1,N):
    j, p = i-1, A[i]
    while j >= 0 and A[j] > p:
        A[j+1] = A[j]
        j -= 1
    A[j+1] = p
    print(" ".join(map(str, A))) from __future__ import division, print_function, unicode_literals from future_builtins import * N = int(raw_input()) N int(raw_input()) int raw_input() raw_input A = list(map(int, raw_input().split())) A list(map(int, raw_input().split())) list map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split print(" ".join(map(str, A))) print " ".join(map(str, A)) " ".join " " join map(str, A) map str A for i in xrange(1,N):
    j, p = i-1, A[i]
    while j >= 0 and A[j] > p:
        A[j+1] = A[j]
        j -= 1
    A[j+1] = p
    print(" ".join(map(str, A))) i xrange(1,N) xrange 1 N j, p = i-1, A[i] j i-1 i 1 p A[i] A i while j >= 0 and A[j] > p:
        A[j+1] = A[j]
        j -= 1
     j >= 0 and A[j] > p j >= 0 j 0 A[j] > p A[j] A j p A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j j -= 1 j 1 A[j+1] = p A[j+1] A j+1 j 1 p print(" ".join(map(str, A))) print " ".join(map(str, A)) " ".join " " join map(str, A) map str A N = int(raw_input()) int(raw_input()) N p = i-1, A[i] A[i] p j, p = i-1, A[i] i-1 j A = list(map(int, raw_input().split())) list(map(int, raw_input().split())) A j -= 1 1 j
from __future__ import division, print_function, unicode_literals
from future_builtins import *

N = int(raw_input())
A = list(map(int, raw_input().split()))

print(" ".join(map(str, A)))
for i in xrange(1,N):
    j, p = i-1, A[i]
    while j >= 0 and A[j] > p:
        A[j+1] = A[j]
        j -= 1
    A[j+1] = p
    print(" ".join(map(str, A)))