import java.util.Scanner; public class Main_yukicoder207 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); for (int i = a; i <= b; i++) { if (i % 3 == 0) { System.out.println(i); } else { int tmp = i; while (tmp != 0) { if (tmp % 10 == 3) { System.out.println(i); break; } tmp /= 10; } } } sc.close(); } }