l, r = (int(_) for _ in input().split())

r = min(r,l+2019)

x = [i*ii%2019 for i in range(l,r+1) for ii in range(i+1,r+1)]

print((min(x)))

import numpy as np

L,R = (int(x) for x in input().split())



if R - L > 3000:

  print((0))

  exit()

  

x = np.arange(L,R+1,dtype=np.int64)

y = x[:,None] * x[None,:] % 2019

for i in range(len(x)):

  y[i,i] = 3000

answer = y.min()

print(answer)

l, r = (int(_) for _ in input().split())
r = min(r, l + 2019)
x = [i * ii % 2019 for i in range(l, r + 1) for ii in range(i + 1, r + 1)]
print((min(x)))

import numpy as np

L, R = (int(x) for x in input().split())
if R - L > 3000:
    print((0))
    exit()
x = np.arange(L, R + 1, dtype=np.int64)
y = x[:, None] * x[None, :] % 2019
for i in range(len(x)):
    y[i, i] = 3000
answer = y.min()
print(answer)

-l, r = (int(_) for _ in input().split()) -r = min(r, l + 2019) -x = [i * ii % 2019 for i in range(l, r + 1) for ii in range(i + 1, r + 1)] -print((min(x))) +import numpy as np + +L, R = (int(x) for x in input().split()) +if R - L > 3000: +    print((0)) +    exit() +x = np.arange(L, R + 1, dtype=np.int64) +y = x[:, None] * x[None, :] % 2019 +for i in range(len(x)): +    y[i, i] = 3000 +answer = y.min() +print(answer)