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

solve :: VU.Vector Int -> Int -> Int -> Int
solve ys n x
    |  x < a = a
    |  otherwise = b
    where 
        q = n `quot` 2
        a = ys VU.! q 
        b = ys VU.! (q - 1)
        
main = do
    n <- readLn :: IO Int
    xs <- map (fst . fromJust . B.readInt) . B.words <$> B.getLine :: IO [Int]
    let ys = VU.fromList $ sort xs
    forM_ xs $ \x -> print $ solve ys n x