import java.util.Scanner; public class world { public static void main(String[] args) { Scanner sn = new Scanner(System.in); int a = sn.nextInt(); int b = sn.nextInt(); sn.close(); if (b - a >= 100) { return; } for (int i = a; i <= b; i++) { String s = String.valueOf(i); if (i % 3 == 0) { System.out.println(i); } else if (s.contains("3")) { System.out.println(i); } else { return; } } } }