import Data.List


main = do
  n <- read <$> getLine::IO Int
  xs <- map read . words <$> getLine ::IO [Int]
  let xs_ = sort xs 
  let (m1,m2) = (xs_!!(div n 2),xs_!!(div n 2)) 
  mapM_ print $ solve m1 m2 xs

--solve :: Int -> Int -> [Int] -> Int -> [Int] -> [Int]
solve _ _ [] = []
solve m1 m2 (x:xs)  =
  (if x<m1 then m2 else m1) : solve m1 m2 xs



