import java.util.Scanner; import java.util.stream.IntStream; public class No207 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int from = s.nextInt(); int to = s.nextInt(); IntStream.range(from, to + 1).forEach(n -> { if (n % 3 == 0 || (n + "").contains("3")) { System.out.println(n); } }); } }