import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); for (int i = a; i <= b; i++) { if (i % 3 == 0 || i / 10 == 3 || i % 10 == 3) { System.out.println(i); } } scan.close(); } }