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

main = do
    l  <- read <$> getLine
    xs <- map (read :: String -> Int) . words <$> getLine
    let
        s = sort xs
        (m1, m2) = (s !! (l `div` 2), s !! (l `div` 2 - 1))
    forM_ xs $ \val ->
        if val < m1 then print m1 else print m2