use std::io::stdin; fn get_line() -> String { let mut line = String::new(); stdin().read_line(&mut line).ok(); line } fn main() { let line = get_line(); let line: Vec<&str> = line.trim().split_whitespace().collect(); let line: Vec = line.iter().map(|x| x.parse().unwrap()).collect(); let a = line[0]; let b = line[1]; let mut results: Vec = Vec::new(); for i in a..b + 1 { if i % 3 == 0 { results.push(i); continue; } let mut c = i; loop { if c < 10 { break; } if i % 10 == 3 { results.push(i); } if i / 10 == 3 { results.push(i); } c = c / 10; } } for i in results.iter() { println!("{}", i); } }