#include int find3(int); int main(void) { int a, b; scanf("%d,%d", &a, &b); for (a; a <= b; a++) { if (find3(a)) printf("%d\n", a); } return 0; } int find3(int a) { if (a % 3 == 0) return 1; while (a > 0) { if (a % 10 == 3) return 1; a /= 10; } }