package no207; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long a = sc.nextLong(); long b = sc.nextLong(); for(long x=a;x<=b;x++) { if (isAho(x)) { System.out.println(x); } } } public static boolean isAho(long n) { if (n % 3 == 0) { return true; } while(n > 0) { if (n % 10 == 3) { return true; } n/=10; } return false; } }