n = int(input())
x = list(map(int,input().split()))
print (*x)
for i in range(1,n):
    v = x[i]
    j = i - 1
    while j >= 0:
        if x[j] > v:
            x[j + 1] = x[j]
            x[j] = v
        j += -1
    print (*x) n = int(input()) n int(input()) int input() input x = list(map(int,input().split())) x list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split print (*x) print *x x for i in range(1,n):
    v = x[i]
    j = i - 1
    while j >= 0:
        if x[j] > v:
            x[j + 1] = x[j]
            x[j] = v
        j += -1
    print (*x) i range(1,n) range 1 n v = x[i] v x[i] x i j = i - 1 j i - 1 i 1 while j >= 0:
        if x[j] > v:
            x[j + 1] = x[j]
            x[j] = v
        j += -1
     j >= 0 j 0 if x[j] > v:
            x[j + 1] = x[j]
            x[j] = v
         x[j] > v x[j] x j v x[j + 1] = x[j] x[j + 1] x j + 1 j 1 x[j] x j x[j] = v x[j] x j v j += -1 j -1 print (*x) print *x x j = i - 1 i - 1 j n = int(input()) int(input()) n j += -1 -1 j v = x[i] x[i] v x = list(map(int,input().split())) list(map(int,input().split())) x
n = int(input())
x = list(map(int,input().split()))
print (*x)
for i in range(1,n):
    v = x[i]
    j = i - 1
    while j >= 0:
        if x[j] > v:
            x[j + 1] = x[j]
            x[j] = v
        j += -1
    print (*x)