import Control.Applicative ((<$>))
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as B
import Data.List
import Data.Function (on)
import Data.Char (isSpace)

main :: IO ()
main = do
  n <- readLn
  solve n <$> getl (readil B.readInt) >>= mapM_ print

solve :: Int -> [(Int,Int)] -> [Int]
solve n xs = map snd $ sort ls'
  where
    ls = sortBy (compare `on` snd) xs
    c = n `div` 2
    lm = snd $ ls !! (c - 1)
    rm = snd $ ls !! c
    ls' = (map (\(i,x) -> (i, rm)) f) ++ (map (\(i,x) -> (i, lm)) b)
    (f, b) = splitAt c ls
    
getl :: (ByteString -> a) -> IO a
getl f = f <$> B.getLine

readil :: Integral a =>  (ByteString -> Maybe (a, ByteString)) -> ByteString -> [(Int,a)]
readil f x = unfoldr g (1, x)
  where
    g (i, s) = do
      (n, s') <- f s
      return ((i,n), (i+1, B.dropWhile isSpace s'))
