import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Storable as V

main=do
    n<-readLn::IO Int
    xs<-unfoldr (B.readInt.B.dropWhile(==' '))<$>B.getLine
    --
    let ys=V.fromList.sort $ xs
    let m1= ys V.! ((n `div` 2)-1)
    let m2= ys V.! (n `div` 2)
    --
    sequence_ $ map (print.(f m1 m2)) xs

f m1 m2 x = if x < m2 then m2 else m1