import java.math.BigInteger; import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int a=sc.nextInt(); int b=sc.nextInt(); String check; for(int i=a;i<=b;i++){ check=String.valueOf(a); if(check.indexOf("3")==-1){ System.out.println(a); continue; } if(a%3==0){ System.out.println(a); } } } }