import Data.List
import Control.Applicative

main = do
  _ <- getLine
  xs <-  map read <$> words <$> getLine :: IO [Int]
  --let xs = [1,2,2,3]
  let bp = length xs `div` 2
  let xs' = sort xs
  let b1 = xs' !! (bp - 1)
  let b2 = xs' !! bp
  mapM_ print $ map (\i -> if i > b1 then b1 else b2) xs
