import Data.List import Control.Applicative import Control.Monad main = do [a, b] <- map read . words <$> getLine mapM_ print $ filter (\x -> if x `mod` 3 == 0 || '3' `elem` (show x) then True else False) [a..b]