N=int(input())
arr=list(map(int,input().split()))
print(' '.join(map(str,arr)))
for key in range(1,len(arr)):
    temp=arr[key]
    i=key-1
    while i>=0 and arr[i]>temp:
        arr[i+1]=arr[i]
        i-=1
    arr[i+1]=temp
    print(' '.join(map(str,arr))) N=int(input()) N int(input()) int input() input arr=list(map(int,input().split())) arr list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split print(' '.join(map(str,arr))) print ' '.join(map(str,arr)) ' '.join ' ' join map(str,arr) map str arr for key in range(1,len(arr)):
    temp=arr[key]
    i=key-1
    while i>=0 and arr[i]>temp:
        arr[i+1]=arr[i]
        i-=1
    arr[i+1]=temp
    print(' '.join(map(str,arr))) key range(1,len(arr)) range 1 len(arr) len arr temp=arr[key] temp arr[key] arr key i=key-1 i key-1 key 1 while i>=0 and arr[i]>temp:
        arr[i+1]=arr[i]
        i-=1
     i>=0 and arr[i]>temp i>=0 i 0 arr[i]>temp arr[i] arr i temp arr[i+1]=arr[i] arr[i+1] arr i+1 i 1 arr[i] arr i i-=1 i 1 arr[i+1]=temp arr[i+1] arr i+1 i 1 temp print(' '.join(map(str,arr))) print ' '.join(map(str,arr)) ' '.join ' ' join map(str,arr) map str arr arr=list(map(int,input().split())) list(map(int,input().split())) arr temp=arr[key] arr[key] temp N=int(input()) int(input()) N i=key-1 key-1 i i-=1 1 i
N=int(input())
arr=list(map(int,input().split()))
print(' '.join(map(str,arr)))
for key in range(1,len(arr)):
    temp=arr[key]
    i=key-1
    while i>=0 and arr[i]>temp:
        arr[i+1]=arr[i]
        i-=1
    arr[i+1]=temp
    print(' '.join(map(str,arr)))