import Data.List

deleteAt n xs = init front ++ back
    where
        (front, back) = splitAt n xs

manyMedians :: Int -> [Int] -> [Int]
manyMedians n xs = [median i | i <- [1..n]]
    where median i = genericIndex (sort . deleteAt i $ xs) (n `div` 2 - 1)
        
main :: IO ()
main = do
    n <- read <$> getLine
    xs <- map read . words <$> getLine
    putStrLn . unwords . map show $ manyMedians n xs