import java.util.Arrays; import java.util.Scanner; public class length{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int i; for(i=a; i<=b;i++){ String s = Integer.toString(i); if(i % 3 ==0||s.contains("3")){ System.out.println(i); } } sc.close(); } }