import Data.List
import Control.Monad

cutOut :: [Int] -> [Int] -> [Int]
cutOut [l,r] as = take (r-l+1) (drop (l-1) as)

median :: [Int] -> Int
median [] =  0
median ns =  ((sort ns) !! (div (length ns) 2))

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