#include int main(void){ long A, B; scanf("%ld %ld",&A, &B); for(long i=A;i<=B;i++){ int c = i%3; long d; if(c==0){ printf("%ld\n",i); }else{ for(d=i;d>10;d/=10){ if(d%10==3||d/10==3){ printf("%ld\n",i); } } } } }