import Data.List
import Data.Ord
import Data.Function

type Index = Int

numberingSort :: [Int] -> [(Index, Int)]
numberingSort = sortBy (comparing snd) . zip [1..]

deleteIndex :: Index -> [(Index, Int)] -> [(Index, Int)]
deleteIndex i = deleteBy ((==) `on` fst) (i,0)

manyMedians n xs = [takeMedian i | i <- [1..n]]
    where
        sorted = numberingSort xs
        middleIndex = (n - 1) `div` 2
        takeMedian i = snd $ genericIndex (deleteIndex i sorted) middleIndex

main :: IO ()
main = do
    n <- read <$> getLine
    xs <- map read . words <$> getLine
    putStrLn . unwords . map show $ manyMedians n xs