import sys
import math

n = input()
a = map(int, raw_input().split())

for i in xrange(n) :
    tmp = a[i]
    a.pop(i)

    for j in xrange(i) :
        if a[j] > tmp :
            a.insert(j, tmp)
            break
    else :
        a.insert(i, tmp)

    for j in xrange(n) :
        sys.stdout.write(str(a[j]))
        if j < n-1 :
            sys.stdout.write(" ")

    print import sys sys import math math n = input() n input() input a = map(int, raw_input().split()) a map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split for i in xrange(n) :
    tmp = a[i]
    a.pop(i)

    for j in xrange(i) :
        if a[j] > tmp :
            a.insert(j, tmp)
            break
    else :
        a.insert(i, tmp)

    for j in xrange(n) :
        sys.stdout.write(str(a[j]))
        if j < n-1 :
            sys.stdout.write(" ")

    print i xrange(n) xrange n tmp = a[i] tmp a[i] a i a.pop(i) a.pop a pop i for j in xrange(i) :
        if a[j] > tmp :
            a.insert(j, tmp)
            break
    else :
        a.insert(i, tmp)

     j xrange(i) xrange i if a[j] > tmp :
            a.insert(j, tmp)
            break
     a[j] > tmp a[j] a j tmp a.insert(j, tmp) a.insert a insert j tmp break a.insert(i, tmp) a.insert a insert i tmp for j in xrange(n) :
        sys.stdout.write(str(a[j]))
        if j < n-1 :
            sys.stdout.write(" ")

     j xrange(n) xrange n sys.stdout.write(str(a[j])) sys.stdout.write sys.stdout sys stdout write str(a[j]) str a[j] a j if j < n-1 :
            sys.stdout.write(" ")

     j < n-1 j n-1 n 1 sys.stdout.write(" ") sys.stdout.write sys.stdout sys stdout write " " print a = map(int, raw_input().split()) map(int, raw_input().split()) a n = input() input() n tmp = a[i] a[i] tmp
import sys
import math

n = input()
a = map(int, raw_input().split())

for i in xrange(n) :
    tmp = a[i]
    a.pop(i)

    for j in xrange(i) :
        if a[j] > tmp :
            a.insert(j, tmp)
            break
    else :
        a.insert(i, tmp)

    for j in xrange(n) :
        sys.stdout.write(str(a[j]))
        if j < n-1 :
            sys.stdout.write(" ")

    print