L, R = list(map(int, input().split()))

ans = 10**20



if R-L < 2019:

    ans = 10**20



    for i in range(L, R):

        n = i % 2019

        for j in range(i+1, R+1):

            ans = min(ans, n * j % 2019)

else:

    ans = 0

print(ans)
import numpy as np



L, R = list(map(int, input().split()))



if R-L < 2019:

    ans = 10**20



    for i in range(L, R):

        ans = min(ans, np.min(np.arange(i+1, R+1) * i % 2019))

else:

    ans = 0

print(ans)
L, R = list(map(int, input().split()))
ans = 10**20
if R - L < 2019:
    ans = 10**20
    for i in range(L, R):
        n = i % 2019
        for j in range(i + 1, R + 1):
            ans = min(ans, n * j % 2019)
else:
    ans = 0
print(ans)

import numpy as np

L, R = list(map(int, input().split()))
if R - L < 2019:
    ans = 10**20
    for i in range(L, R):
        ans = min(ans, np.min(np.arange(i + 1, R + 1) * i % 2019))
else:
    ans = 0
print(ans)

+import numpy as np + -ans = 10**20 -        n = i % 2019 -        for j in range(i + 1, R + 1): -            ans = min(ans, n * j % 2019) +        ans = min(ans, np.min(np.arange(i + 1, R + 1) * i % 2019))