let solve a b = let rec has3 num = if num = 0 then false else ( let dig1 = num mod 10 in if dig1 = 3 || dig1 = -3 then true else has3 (num / 10)) in let rec solve' i = if i > b then () else ( if i mod 3 = 0 || has3 i then print_endline (string_of_int i); solve' (i + 1)) in solve' a let () = let a, b = read_line () |> fun l -> Scanf.sscanf l "%d %d" (fun a b -> (a, b)) in solve a b