{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import qualified Data.ByteString.Char8 as BC
import           Data.Maybe            (fromJust)
import           Data.Sequence         as S

main :: IO ()
main = do
  n <- readLn
  xs <- getInts
  putStr . unlines . map show $ solve n xs

solve :: Int -> [Int] -> [Int]
solve n xs = map f xs
  where f x = if x <= a then b else a
        a = S.index v (n `div` 2 - 1)
        b = S.index v (n `div` 2)
        v = S.unstableSort $ S.fromList xs

readInts :: BC.ByteString -> [Int]
readInts = map (fst . fromJust . BC.readInt) . BC.words

getInts :: IO [Int]
getInts = readInts <$> BC.getLine
