import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.List
import Control.Monad

main = do
  li <- BS.getLine
  let Just (n,_) = BS.readInt li
  li <- BS.getLine
  let xs = unfoldr (BS.readInt . BS.dropWhile isSpace) li
  let ans = compute n xs
  mapM_ print ans

compute :: Int -> [Int] -> [Int]
compute n xs = [ if x <= xi then xj else xi | x <- xs ]
  where
    (xi:xj:_) = drop (div n 2 - 1) $ sort xs

{-
ちょうど真ん中の両側を xi xj (j=i+1) とする。
xi以下の要素を抜いた系列の中央値はxj
xj以上の要素を抜いた系列の中央値はxi
-}
