use std::io; fn main() { let mut input = String::new(); io::stdin().read_line(&mut input).unwrap(); let mut input = input.trim().split_whitespace(); let a: u32 = input.next().unwrap().parse().unwrap(); let b: u32 = input.next().unwrap().parse().unwrap(); for i in a..b { if i % 3 == 0 || is_including_3(i) { println!("{}", i); } } } fn is_including_3(num: u32) -> bool { let mut n = num; loop { if n % 10 == 3 { return true; } else if n == 0 { return false; } else { n /= 10; } } }