import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long A = sc.nextLong(); long B = sc.nextLong(); while(A<=B){ if(A%3==0){ System.out.println(A); }else if((A/10)==3){ System.out.println(A); } A++; } } }