a,b = map(int,input().split()) for i in range(b-a+1): c = a+i if c%3 == 0: print(c) elif inr(c) in ("3"): print(c)