import Control.Monad
import Data.List
main = getLine >>= main' . map read . words
    where
        main' [0, 0, 0] = return ()
        main' xs@(m : _) = replicateM m readLn >>= print . solve xs . sort >> main

solve :: [Int] -> [Int] -> Int
solve [m, nmin, nmax] xs = fst . fst $ foldl' ff ((m, -1), xs) [m - 1, (m - 2)..nmin]
    where
        ff (prev@(prevn, prevp), (a : b : cs)) n
            | n > nmax = (prev, b : cs)
            | p <= prevp = (prev, b : cs)
            | otherwise = ((n, p), b : cs)
            where
                p = b - a