import Data.List

f :: Int -> [Int] -> [Int]
f n xs = [if x <= a then b else a | 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