import qualified Data.Sequence as S

main :: IO ()
main = do
  n <- readLn
  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 - 1) < xl = xr
  | otherwise = xl
  where
    ys = S.fromList xs
    zs = S.sort ys
    xl = S.index zs ((n - 3) `div` 2)
    xr = S.index zs ((n - 1) `div` 2)


