import Data.List (sort)

main = do
  n <- readLn
  xn <- map read . words <$> getLine::IO[Int]
  let sn = sort xn
  let upMedian = sn !! (div n 2)
  let downMedian = sn !! ((div n 2) - 1)
  mapM_ print $ map (\x -> if x < upMedian then upMedian else downMedian) xn