import Data.List

manyMedians :: Int -> [Int] -> IO ()
manyMedians n xs = mapM_ (\a -> if a < b1 then print b1 else print b2) xs
    where
        ys = sort $ xs
        (b1,b2) = (ys !! (n `div` 2), ys !! (n `div` 2 - 1))
        
main :: IO ()
main = do
    n <- read <$> getLine
    xs <- map read . words <$> getLine
    manyMedians n xs