A=int(input())
B=int(input())
for i in range(A,B):
for x in str(i):
if x not in ["1","3","5","7","9"]:
break
else:
print(i)
A=int(input())
B=int(input())
for i in range(A,B):
for x in str(i):
if x not in ["1","3","5","7","9"]:
break
else:
print(i)