import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int start=sc.nextInt(); int end=sc.nextInt(); for(int i=start;i<=end;i++) { if(isAho(i)) { System.out.println(i); } } sc.close(); } public static boolean isAho(int n) { if(n%3==0) { return true; } return containThree(n); } public static boolean containThree(int n) { while(n>0) { if(n%10==3) { return true; } n/=10; } return false; } }