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