package b2015_09_19; import java.util.Scanner; public class No207 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long A = sc.nextLong(); long B= sc.nextLong(); for(; A<=B; A++){ String str = String.valueOf(A); if(A%3==0 || str.indexOf("3")!=-1){ System.out.println(A); } } } }