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