A, B = map(int, input().split()) for i in range(A,B): if i % 3 == 0: print (i) s = str(i) if s.count('3'): print (i)