import Data.List
import Data.Maybe
import qualified Data.ByteString.Char8 as B
import Control.Monad

getInts :: IO [Int]
getInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine

medians :: [Int] -> (Int, Int)
medians xs = (xs' !! (half - 1), xs' !! half)
  where xs' = sort xs
        half = length xs `div` 2

main :: IO ()
main = do
  getLine
  xs <- getInts
  let (m1, m2) = medians xs
  forM_ xs $ \x ->
  	print $ if x < m2 then m2 else m1
