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); } else { let str = i.to_string(); let str = str.as_str(); for j in str.chars() { if j == '3' { results.push(i); break; } } } } for i in results.iter() { println!("{}", i); } }