a,b = map(int, input().split()) c = [] for i in range(a,b+1): c.append(str(i)) result = [] for j in c: if '3' in j: print(int(j)) else: continue