let n = Scanf.scanf " %d" (+) 0
let xs = Array.init n @@ fun i -> Scanf.scanf " %d" (+) 0
let rs = Array.copy xs
let _ = Array.(sort (-) rs; iter (fun x -> Printf.printf "%d\n" @@ if rs.(n / 2 - 1) < x then rs.(n / 2 - 1) else rs.(n / 2)) xs)