module Main where

import Control.Applicative
import Control.Monad
import Data.List (sort)

main :: IO ()
main = do
    n <- readLn
    xs <- fmap read . words <$> getLine :: IO [Int]
    let [a, b] = take 2 . drop (n `div` 2 - 1) $ (sort xs)
    forM_ xs $ \x -> do
        if x >= b
            then print a
            else print b