import qualified Data.Sequence as S

main :: IO ()
main = do
  n <- getLine
  xs <- map read.words <$> getLine
  mapM_ (print . solve n xs) $ [1..n]

solve :: Int -> [Int] -> Int -> Int
solve n xs i
  | S.index ys i < xl = xr
  | otherwise = xl
  where
    ys = S.fromList xs
    zs = S.fromList $ sort xs
    xl = S.index zs ((n - 1) `div` 2)
    xr = S.index zs ((n + 1) `div` 2)


