X = 2020
flag = 0
while True:
if X%2019==0:
flag = 0
for i in str(X):
if int(i)%2==0:
flag = 1
if flag == 0:
print(X)
break
X += 1
X = 2020
flag = 0
while True:
if X%2019==0:
flag = 0
for i in str(X):
if int(i)%2==0:
flag = 1
if flag == 0:
print(X)
break
X += 1