#include int ret3 (int x); int main(void){ int A, B, i; scanf("%d%d", &A, &B); for(i=A;i<=B;i++) if(!(i%3) || ret3(i)) printf("%d\n", i); return 0; } int ret3 (int x){ int y=x; do{ if(!(y%10-3)) return 1; y=y/10; } while(!y); return 0; }