main::IO() main = do as<- fmap (fmap read . words) getLine let (min:max:_) =as ::[Integer] baisuu s = s `mod` 3 == 0 threeTukiSuu s = (length . filter (=='3') $ show s) /= 0 result =filter (\s-> baisuu s || threeTukiSuu s) [min..max] mapM_ print result