import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); int n = 1; int x = 0; for(int i = a; i <= b; i++) { if(i % 3 == 0) { System.out.println(i); } else { x = i; while(n > 0) { if(x % 10 == 3) { System.out.println(i); break; } else { x = x / 10; if(x == 0) { break; } } } } } } }