n = gets.to_i
array = gets.split(' ').map {|a| a.to_i }

for i in 0..n-1
    for j in i+1..n-1
        if array[i] > array[j] then
            array[i], array[j] = array[j], array[i]
        end
    end
    puts array.join(' ')
end