import Data.List

main = do
  n <- readLn :: IO Int
  xs <- getLine >>= return . map read . words :: IO [Int]
  
  let
    ys = sort xs
    a = ys !! (div n 2 - 1)
    b = ys !! (div n 2)
    
  mapM_ print $ map (\x -> if x <= a then b else a) xs
