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