import java.util.Scanner; public class Yuki3 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); scan.close(); for(int i= a; i <= b; i++) { String str = String.valueOf(i); if(i % 3 == 0 || str.indexOf("3") != -1){ System.out.println(i); } } } }