#include int main(void){ int i, j; int A, B; char str[10]; int counter = 0; scanf("%d%d", &A,&B); for(i = A; i <= B; i++){ sprintf(str, "%d", i); if(i % 3 == 0){ printf("%d\n", i); }else{ for(j = 0; str[j] != '\0'; j++){ if(str[j] == '3') counter++; } if(counter > 0) printf("%d\n", i); counter = 0; } } return 0; }