import Control.Monad
import Data.List

main = do
  n <- read <$> getLine
  a <- map read . words <$> getLine
  forM_ (solve n a) $ \t ->
    putStrLn . show $ t

solve :: Int -> [Int] -> [Int]
solve n a = 
  let (sorted, sortnum) = unzip $ sort $ zip a [1..]
      med = sorted !! (n `div` 2)
      medPrev = sorted !! ((n `div` 2) - 1)
      medNext = sorted !! ((n `div` 2) + 1)
  in snd $ unzip $ sort $ zip sortnum (map (\x -> if x <= n `div` 2 then med else medPrev) [1..n])
  
      
