import Data.List (sort)
readInt    = read :: String -> Int
getInt     = readInt <$> getLine
getIntList = map readInt . words <$> getLine
search = aux 0
  where
    aux c m (a:as)
      | c == m    = (a, head as)
      | otherwise = aux (c+1) m as
main = do
  n  <- getInt
  t_xs <- getIntList
  let
    xs = sort t_xs
    (n1, n2) = search (n `div` 2 - 1) xs
  forM_ t_xs $ \x ->
    print $ if x <= n1 then n2 else n1