package b2015_5_31; import java.util.Scanner; public class SekaiNantoka { 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(match(i)){ System.out.println(i); } } } private static boolean match(int i){ if(i%3==0){ return true; } while(i>0){ if(i%10==3){ return true; }else{ i /= 10; } } return false; } }