import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T
import Data.List (sort)

main :: IO ()
main = do
  n <- unsafeSignedDecimal <$> T.getLine :: IO Int
  ds <- map unsafeSignedDecimal . T.words <$> T.getLine :: IO [Int]
  let
    n' = n `div` 2
    ds' = sort ds
    (l : m : _) = drop (pred n') ds'
  print (m - l)

unsafeSignedDecimal :: T.Text -> Int
unsafeSignedDecimal s = case T.signed T.decimal s of
  Right (n, _) -> n
