import Data.List
import Control.Monad

solve :: Int -> [Int] -> [Int]
solve n xs = map choiceMedian xs
  where sorted = sort xs
        n1 = n `div` 2
        n2 = n1 + 1
        median1 = sorted !! (n1 - 1)
        median2 = sorted !! (n2 - 1)
        choiceMedian n = if n <= median1 then median2 else median1

main :: IO ()
main = do
  n  <- readLn
  xs <- map read . words <$> getLine
  mapM_ print $ solve n xs