import java.util.*; public class Main { public static void main(String[] args) throws Exception { // Your code here! Scanner sc=new Scanner(System.in); int num1=sc.nextInt(); int num2=sc.nextInt(); for(int i=num1;i<=num2;i++) { if(i%3==0) { System.out.println(i); } else if(i%10==3) { System.out.println(i); } } } }