n = int(input())
data = list(map(int, input().split()))

def insertionsort(a, n):
    for i in range(n):
        v = a[i]
        j = i - 1;
        while (j >= 0 and a[j] > v):
            a[j+1] = a[j]
            j -= 1
        a[j+1] = v
        print(*a)

insertionsort(data, n) n = int(input()) n int(input()) int input() input data = list(map(int, input().split())) data list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def insertionsort(a, n):
    for i in range(n):
        v = a[i]
        j = i - 1;
        while (j >= 0 and a[j] > v):
            a[j+1] = a[j]
            j -= 1
        a[j+1] = v
        print(*a) insertionsort for i in range(n):
        v = a[i]
        j = i - 1;
        while (j >= 0 and a[j] > v):
            a[j+1] = a[j]
            j -= 1
        a[j+1] = v
        print(*a) i range(n) range n v = a[i] v a[i] a i j = i - 1 j i - 1 i 1 while (j >= 0 and a[j] > v):
            a[j+1] = a[j]
            j -= 1
         j >= 0 and a[j] > v j >= 0 j 0 a[j] > v a[j] a j v a[j+1] = a[j] a[j+1] a j+1 j 1 a[j] a j j -= 1 j 1 a[j+1] = v a[j+1] a j+1 j 1 v print(*a) print *a a a a n n insertionsort(data, n) insertionsort data n data = list(map(int, input().split())) list(map(int, input().split())) data def insertionsort(a, n):
    for i in range(n):
        v = a[i]
        j = i - 1;
        while (j >= 0 and a[j] > v):
            a[j+1] = a[j]
            j -= 1
        a[j+1] = v
        print(*a) def insertionsort(a, n):
    for i in range(n):
        v = a[i]
        j = i - 1;
        while (j >= 0 and a[j] > v):
            a[j+1] = a[j]
            j -= 1
        a[j+1] = v
        print(*a) insertionsort n = int(input()) int(input()) n
n = int(input())
data = list(map(int, input().split()))

def insertionsort(a, n):
    for i in range(n):
        v = a[i]
        j = i - 1;
        while (j >= 0 and a[j] > v):
            a[j+1] = a[j]
            j -= 1
        a[j+1] = v
        print(*a)

insertionsort(data, n)