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