module Main where main :: IO () main = do [a, b] <- fmap (map read . words) getLine :: IO [Int] mapM_ print [x | x <- [a..b], x `mod` 3 == 0 || '3' `elem` show x]