N = gets.to_i A = gets.split(" ").map.with_index{|s, i| [s.to_i, i+1]} top = true ans = [] A.sort_by{|x, i| -x}.each {|x, i| if top then ans.unshift(i.to_s) else ans.push(i.to_s) end top = !top } i = ans.index("1") puts (ans[i, N-i] + ans[0, i] + ["1"]).join(" ")