a,b=map(int,input().split()) for i in range(a,b+1): flag=0 tmp=i while tmp!=0: if (tmp%10)==3: flag=1 break tmp=tmp//10 if i%3==0 or flag==1: print(i)