import Data.Function
import Data.List

f :: Int -> [Int] -> [Int]
f n xs = [if x <= a then a else b | x <- xs ]
  where
    [a,b] = take 2 $ drop (div n 2 - 1) (sort xs)
  

main = do
  n <- readLn
  xs <- (map read . words) <$> getLine
  mapM_ print $ f n xs