main :: IO () main = do input <- getLine let [a, b] = map read (words input) mapM_ print [i | i <- [a..b], i `mod` 3 == 0 || '3' `elem` show i]