import java.util.Scanner; public class WorldN { public static void main(String[] args) { int a; int b; Scanner scanner = new Scanner(System.in); a = scanner.nextInt(); b = scanner.nextInt(); for(int i=a;i<=b;i++){ if(i % 3 == 0 || isThree(i)) System.out.println(i); } } static boolean isThree(int num){ String str = String.valueOf(num); for(int i=0;i