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