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

main :: IO ()
main = do
  n <- read <$> getLine :: IO Int
  xs <- map read.words <$> getLine :: IO [Int]
  let sorted = sort xs
      med0 = sorted!!(n`div`2-1)
      med1 = sorted!!(n`div`2)
  forM_ xs $ \x ->
    print $ if x < med1 then med1 else med0
