{-# LANGUAGE BangPatterns #-}

import qualified Data.ByteString.Char8 as B
import           Data.Char
import qualified Data.IntMap           as M
import           Data.List
import qualified Data.Sequence         as C

main :: IO ()
main = do
    n <- readLn
    as <- unfoldr (B.readInt . B.dropWhile isSpace) <$> B.getLine
    print $ solve n as

getMap n = foldl' f M.empty . zip counts
    where
        counts = zipWith min [1,3..] [(2*n),(2*n-2)..0]
        f mp (count, x) = M.insertWith (+) x count mp

solve :: Int -> [Int] -> Int
solve n = median n . foldl' f M.empty . zip counts
    where
        counts = zipWith min [1,3..] [(2*n),(2*n-2)..0]
        f mp (count, x) = M.insertWith (+) x count mp

median :: Int -> M.IntMap Int -> Int
median n xs = go 0 xs
    where
        go !acc xs = let ((k, v), ys) = M.deleteFindMin xs
                         acc' = acc + v
                     in if acc' * 2 >= total
                         then k
                         else go acc' ys
        total = ((n^2 + n + 2) `div` 2)
