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