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)

takeMedian :: [(Index, Int)] -> Int
takeMedian xs = snd . genericIndex xs $ length xs `div` 2

manyMedians n xs = [takeMedian . deleteIndex i . numberingSort $ xs | i <- [1..n]]


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