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(); let mut vec = vec![1u32; b as usize]; for i in a..b { vec[i as usize] = i; } let iterator = vec.into_iter() .filter(|x| x % 3 == 0 || is_including_3(*x)); for i in iterator { 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; } } }