n=gets.to_i a=gets.chomp.split(" ").map(&:to_i) n_=2*n-3 n_.times do|i| n.times do|p_| q=i-p_ if !(q>p_&&n-1>=q) next elsif a[p_]>a[q] w=a[p_] a[p_]=a[q] a[q]=w end end end print a.join(" ")