import java.util.Scanner; public class No207 { private static final String k = " "; public static void main(String[] args) { String input = null; Scanner sc = new Scanner(System.in); input = sc.nextLine(); String[] split = input.split(k); int a = Integer.parseInt(split[0]); int b = Integer.parseInt(split[1]); for (int i = a; i <= b; i++) { if (i % 3 == 0 || String.valueOf(i).contains("3")) System.out.println(i); } sc.close(); } }