N = int(input())
A = [int(s) for s in input().split()]

print(' '.join([str(item) for item in A]))
for i in range(1, N):
    key = A[i]
    j = i - 1
    while j >= 0 and A[j] > key:
        A[j+1] = A[j]
        j = j - 1
    A[j+1] = key
    print(' '.join([str(item) for item in A])) N = int(input()) N int(input()) int input() input int(s) for s in input().split() for s in input().split() s input().split() ().split () input split for s in input().split() int(s) int s A = [int(s) for s in input().split()] A [int(s) for s in input().split()] str(item) for item in A for item in A item A for item in A str(item) str item print(' '.join([str(item) for item in A])) print ' '.join([str(item) for item in A]) ' '.join ' ' join [str(item) for item in A] for i in range(1, N):
    key = A[i]
    j = i - 1
    while j >= 0 and A[j] > key:
        A[j+1] = A[j]
        j = j - 1
    A[j+1] = key
    print(' '.join([str(item) for item in A])) i range(1, N) range 1 N key = A[i] key A[i] A i j = i - 1 j i - 1 i 1 while j >= 0 and A[j] > key:
        A[j+1] = A[j]
        j = j - 1
     j >= 0 and A[j] > key j >= 0 j 0 A[j] > key A[j] A j key 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] = key A[j+1] A j+1 j 1 key str(item) for item in A for item in A item A for item in A str(item) str item print(' '.join([str(item) for item in A])) print ' '.join([str(item) for item in A]) ' '.join ' ' join [str(item) for item in A] A = [int(s) for s in input().split()] [int(s) for s in input().split()] A N = int(input()) int(input()) N j = j - 1 j - 1 j j = i - 1 i - 1 j key = A[i] A[i] key
N = int(input())
A = [int(s) for s in input().split()]

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