a,b = map(int,raw_input()) for i in xrange(a,b+1): if i%10==3: print i elif i%3==0: print i