A, B = map(int, input().split()) for i in (A,B+1): word = str(i) if '3' in word == True: print(i)