import Data.Char

sumOfDigit :: Int -> Int
sumOfDigit num = sum . map digitToInt $ show num

main :: IO ()
main = do
    num <- read <$> getLine
    [min, max] <- map read . words <$> getLine
    let calculated = filter (\x -> sumOfDigit x <= max && min <= sumOfDigit x) [1 .. num]
    print calculated
    print $ sum calculated 