import Data.List
import Control.Monad

f [l,r] as = take (r-l+1) (drop (l-1) as)

median [] = 0
median ns =
    let l = length ns
        n = div l 2
        ms = sort ns
    in (ms !! (n+1))

main :: IO ()
main = do
    n <- read <$> getLine :: IO Int
    as <- map read.words <$> getLine :: IO [Int]
    print $ median (map median [f [l,r] as | r <- [1..n], l <- [1..r]])
