n=int(input())
l=list(map(int, input().split()))
for i in range(1,n+1):
    l[0:i]=sorted(l[0:i])
    print(*l) n=int(input()) n int(input()) int input() input l=list(map(int, input().split())) l list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split for i in range(1,n+1):
    l[0:i]=sorted(l[0:i])
    print(*l) i range(1,n+1) range 1 n+1 n 1 l[0:i]=sorted(l[0:i]) l[0:i] l 0:i 0 i sorted(l[0:i]) sorted l[0:i] l 0:i 0 i print(*l) print *l l l=list(map(int, input().split())) list(map(int, input().split())) l n=int(input()) int(input()) n
n=int(input())
l=list(map(int, input().split()))
for i in range(1,n+1):
    l[0:i]=sorted(l[0:i])
    print(*l)