import java.util.LinkedHashSet; import java.util.Scanner; import java.util.Set; public class Sekaino { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int from = scan.nextInt(); int to = scan.nextInt(); Set threeList = new LinkedHashSet(); for (int i = from; i <= to; i++) { if (i % 3 == 0 || String.valueOf(i).contains("3")) { threeList.add(i); } } for (int num : threeList) { System.out.println(num); } } }