import qualified Data.Vector.Unboxed as VU
import qualified Data.ByteString.Char8 as B
import Data.List
import Data.Maybe
import Control.Monad

lowerBound :: VU.Vector Int -> (Int, Int) -> Int -> Int
lowerBound vec (from, to) target
    | from == to = from
    | mValue >= target = lowerBound vec (from, mid) target
    | mValue < target = lowerBound vec (mid + 1, to) target
        where
            mid = (from + to) `quot` 2
            mValue = vec VU.! mid

solve :: VU.Vector Int -> Int -> Int -> Int
solve ys n x
    | lb < q = ys VU.! q
    | otherwise = ys VU.! (q-1)
    where 
        q = n `quot` 2
        lb = lowerBound ys (0, n) x
        
main = do
    n <- readLn :: IO Int
    xs <- map (fst . fromJust . B.readInt) . B.words <$> B.getLine :: IO [Int]
    let ys = VU.fromList $ sort xs
    forM_ xs $ \x -> print $ solve ys n x