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