import qualified Data.ByteString.Char8 as BC
import Data.Maybe
import Data.List

readIntsLine :: IO [Int]
readIntsLine = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

main :: IO ()
main = do
  getLine
  xs <- readIntsLine
  let len = length xs
  let sxs = sort xs
  let ixs = map fst . sortOn snd $ zip [1..] $ map fst . sortOn snd $ zip [1..] xs
  let [a, b] = take 2 $ drop (len `div` 2 - 1) sxs
  let mark = len `div` 2
  mapM_ print [if x > mark then a else b | x <- ixs]
