from sys import stdin
 
n = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
print(*A)
for i in range(1, n):
    v = A[i]
    j = i-1
    while j >= 0 and A[j] > v:
        A[j+1] = A[j]
        j = j-1
    else:
        A[j+1] = v
        print(*A) from sys import stdin n = int(stdin.readline().rstrip()) n int(stdin.readline().rstrip()) int stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip int(x) for x in stdin.readline().rstrip().split() for x in stdin.readline().rstrip().split() x stdin.readline().rstrip().split() stdin.readline().rstrip().split stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip split for x in stdin.readline().rstrip().split() int(x) int x A = [int(x) for x in stdin.readline().rstrip().split()] A [int(x) for x in stdin.readline().rstrip().split()] print(*A) print *A A for i in range(1, n):
    v = A[i]
    j = i-1
    while j >= 0 and A[j] > v:
        A[j+1] = A[j]
        j = j-1
    else:
        A[j+1] = v
        print(*A) i range(1, n) range 1 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 = j-1
    else:
        A[j+1] = v
        print(*A) 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 = j-1 j j-1 j 1 A[j+1] = v A[j+1] A j+1 j 1 v print(*A) print *A A n = int(stdin.readline().rstrip()) int(stdin.readline().rstrip()) n j = i-1 i-1 j v = A[i] A[i] v A = [int(x) for x in stdin.readline().rstrip().split()] [int(x) for x in stdin.readline().rstrip().split()] A j = j-1 j-1 j
from sys import stdin
 
n = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
print(*A)
for i in range(1, n):
    v = A[i]
    j = i-1
    while j >= 0 and A[j] > v:
        A[j+1] = A[j]
        j = j-1
    else:
        A[j+1] = v
        print(*A)
