import Control.Monad
import Text.Printf
import Control.Applicative
import qualified Data.Vector as V
import qualified Data.List as L (sortOn)

main :: IO()
main = do
  [n] <- map read . words <$> getLine
  x <- map read . words <$> getLine
  printf "%s\n" $ slv n x

slv :: Int -> [Int] -> String
slv n x = unlines $ map (show . snd) $ L.sortOn fst $ V.toList $ V.map (conv (fst(fst left), fst(fst right)) (n `div` 2)) vec
-- slv n x = unlines $ map (show . snd) $ L.sortOn fst $ V.toList $ V.map (conv (fst left, fst right) (n `div` 2) . snd) vec
  where vec = V.fromList $ zip (L.sortOn fst $ zip x [0..]) [0..]
        (left, right) = (vec V.! ((n `div` 2) - 1), vec V.! (n `div` 2))

conv :: (Int, Int) -> Int -> ((Int, Int), Int) -> (Int, Int)
conv (left, right) bIdx ((val, pidx), idx) | bIdx <= idx = (pidx, left)
                                           | otherwise = (pidx, right)