import Control.Monad
import Data.List
import Data.Array

main = do
  n <- readLn
  xs <- map read . words <$> getLine :: IO [Int]
  let xs_ = sort xs
      m1 = xs_ !! (n `div` 2 - 1)
      m2 = xs_ !! (n `div` 2)
  mapM_ (print . solve (m1, m2) (listArray (1, n+1) xs)) [1..n]

solve (n, m) xs i =
    if xs ! i <= n then m else n