# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_A
def insertion_sort a
  n = a.size
  1.upto(n - 1) do |i|
    key = a[i]
    j = i - 1
    while j >= 0 && a[j] > key
      a[j + 1] = a[j]
      j -= 1
    end
    a[j + 1] = key
    yield a if block_given?
  end
end

n = gets.to_i
a = gets.split.map(&:to_i)

insertion_sort(a) { |b| puts b.join(' ') }