{-# OPTIONS_GHC -O2 #-}
import Control.Applicative
import Data.List
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString as BS
import Data.Maybe (fromJust)

f :: [Int] -> Int
f xs = xs !! m - xs !! (m-1)
    where m = (lenght xs) `div` 2
    
main :: IO()
main = interact $ show.f.sort.map read.words.last.lines
