Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N = int(input())

MMM = map(int,input().split())
MM =list(MMM)
mini = 2020202020
for i in range(N):
  total1 = 0
  total2 = 0
  for j in range(i+1):
    
    total1 += MM[j]
  for k in range(i+1,N):
    
    total2 += MM[k]
  if abs(total1-total2)< mini:
    mini = abs(total1 -total2)
print(mini)

### FIXED CODE ###

N = int(input())

MMM = map(int,input().split())
MM =list(MMM)
mini = 2020202020
list1 = []
total = 0
for i in MM:
  total+=i
  list1.append(total)
for i in list1:
  x = abs(total - 2*i)
  if mini > x:
    mini = x
print(mini)
### BUGGY CODE ###

N = int(input())

def dec(a):
    return a-1

def inc(a):
    return a+1

a = list(map(int,input().split()))
b = list(map(dec,a))
c = list(map(inc,a))

count = a+b+c

set_c = list(set(count))

c = {}
for i in range(len(set_c)):
    c[set_c[i]] = count.count(set_c[i])

print(max(c.values()))

### FIXED CODE ###

N = int(input())

a = list(map(int,input().split()))

x = {}

for i in range(N):

    ai = a[i]

    temp = x.get(ai-1, 0)
    temp += 1
    x[ai-1] = temp

    temp = x.get(ai, 0)
    temp += 1
    x[ai] = temp

    temp = x.get(ai+1, 0)
    temp += 1
    x[ai+1] = temp

X = max(x.values())
print(X)
### BUGGY CODE ###

H,W,K = map(int, input().split())
S = [list(map(int,(list(map(str,input().split()))[0]))) for i in range(H)]
#print(S)
import numpy as np
from itertools import product
"""
H,W,K = 3,5,2
S = [[1,1,1,0,0],
     [1,0,0,0,1],
     [0,0,1,1,1]]
"""

S = np.array(S).T

if np.sum(S)<=K:
    print(0)
else:
    answer = H * W
    for X in product([False,True], repeat=H-1):#分けるか分けないか
        ans = np.sum(X)#横に切った回数
        #print(ans)
        M = [[0]]
        for i, x in enumerate(X):
            if x:
                M.append([])#切った回数箱を増やす
            M[-1].append(i+1)#後ろの箱に切る場所を入れていく
        #print(M)
        D = [0]*len(M)
        #print(D)
        for s in S:
            for k, m in enumerate(M):
                D[k] += np.sum(s[i] for i in m)
                #print("D",D)
            if any(d > K  for d in D):
                ans += 1
                #print("ans",ans)
                D[:] = [np.sum(s[i] for i in m) for m in M]
                
        if answer > ans:
            answer = ans

    print(min(answer,ans))

### FIXED CODE ###


def main():
    from itertools import product
    import numpy as np

    H,W,K = map(int, input().split())
    S = (np.array([list(map(int,list(input()))) for _ in range(H)]).T).tolist()

    if sum(sum(s) for s in S)<=K:
        print(0)
    else:
        answer = (H-1) * (W-1)
        for X in product([False,True], repeat=H-1):
            ans = np.sum(X)
            if ans >= answer:
                continue
            M = [[0]]
            for i, x in enumerate(X):
                if x:
                    M.append([])
                M[-1].append(i+1)
            D = [0]*len(M)
            for s in S:
                for k, m in enumerate(M):
                    D[k] += sum(s[i] for i in m)
                if any(d > K  for d in D):
                    ans += 1
                    if ans >= answer:
                        break
                    for k, m in enumerate(M):
                        D[k] = sum(s[i] for i in m)
                    
                    if any(d > K for d in D):
                        ans = answer + 1
                        break

            answer = min(answer,ans)

        print(answer)

main()
### BUGGY CODE ###

S = input()
r, ans = 0, 0
for l in range(len(S)):
    while r < len(S) and int(S[l:r+1]) % 2019 != 0:
        r += 1
    #print(l,r)
    if int(S[l:r+1]) % 2019 == 0:
        ans += 1
    r = l + 1
print(ans)


### FIXED CODE ###

import sys
from collections import deque
def input():
    return sys.stdin.readline()[:-1]

S = deque(map(int, list(input())))
num = 0
dict = {}
dict[0] = 1
ans = 0

for i in range(len(S)):
    num += S.pop() * pow(10,i,2019)
    cand = num % 2019
    if cand in dict.keys():
        dict[cand] += 1
    else:
        dict[cand] = 1

for key in dict.keys():
    ans += dict[key] * (dict[key] - 1) // 2
print(ans)
### BUGGY CODE ###

from itertools import combinations
import numpy as np

list_len = int(input())
A_list = list(map(int, input().split()))

comb = np.array(list(combinations(A_list, 2)))
comb_mul = np.apply_along_axis(lambda x: x[0]*x[1], 1, comb)
total_sum = sum(comb_mul)
mod_result = total_sum % (10**9+7)

print(mod_result)

### FIXED CODE ###

N = int(input()) #入力する整数
A = list(map(int,input().split())) #入力する数列A
SUMA = sum(A) #数列の和
MOD = 10**9 + 7 # mod
C = [0] * (N-1) #累積和数列
for i in range(N-1): #\sum_{j = i+1}^{N}を求めて数列に代入する
  SUMA -= A[i]
  C[i] = SUMA
ans = 0 #求める答え
for i in range(N-1):
  ans += A[i]*C[i]
  ans %= MOD #その都度modで割った余りにする
print(ans) #答えを出力する
### BUGGY CODE ###

import collections
def input_int_list():
    return [int(thing) for thing in input().split(" ")]

nCr = {}

def nC2(n):
    if n in nCr:
        return nCr[n]
    else:
        val=n*(n-1)//2
        nCr[n]=val
        return val



N=int(input())
A_list=input_int_list()
int_count=collections.Counter(A_list)
for i in range(N):
    number=A_list[i]
    int_count[number]=int_count[number]-1
    print(sum([nC2(int_count[i]) for i in int_count]))
    int_count[number]=int_count[number]+1

### FIXED CODE ###

import collections
def input_int_list():
    return [int(thing) for thing in input().split(" ")]

nCr = {}

def nC2(n):
    if n in nCr:
        return nCr[n]
    else:
        val=n*(n-1)//2
        nCr[n]=val
        return val



N=int(input())
A_list=input_int_list()
int_count=collections.Counter(A_list)
the_sum=sum([nC2(int_count[i]) for i in int_count])
for i in range(N):
    number=A_list[i]
    c=int_count[number]
    print(the_sum-c+1)
### BUGGY CODE ###

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10 ** 9
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    H, W = LI()
    Ch, Cw = LI_()
    Dh, Dw = LI_()
    S = [SS() for _ in range(H)]

    d = ((1, 0), (0, 1), (-1, 0), (0, -1)) 
    d_warp = []
    for i in itertools.product(range(-2, 3), repeat=2):
        if i != (0, 0) and i not in d:
            d_warp.append(i)
    dist = [[INF] * W for _ in range(H)]
    que = collections.deque()
    que.append((Ch, Cw, 0))
    dist[Ch][Cw] = 0
    while que:
        cy, cx, cost = que.popleft()
        for dy, dx in d:
            ny = cy + dy
            nx = cx + dx
            if 0 <= ny < H and 0 <= nx < W and S[ny][nx] == '.' and cost < dist[ny][nx] :
                dist[ny][nx] = cost
                que.appendleft((ny, nx, cost))
        for dy, dx in d_warp:
            ny = cy + dy
            nx = cx + dx
            if 0 <= ny < H and 0 <= nx < W and S[ny][nx] == '.' and cost + 1 < dist[ny][nx] :
                dist[ny][nx] = cost + 1
                que.append((ny, nx, cost + 1))

    if dist[Dh][Dw] == INF:
        print(-1)
    else:
        print(dist[Dh][Dw])

if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    H, W = LI()
    Ch, Cw = LI_()
    Dh, Dw = LI_()
    S = [SS() for _ in range(H)]

    d = ((1, 0), (0, 1), (-1, 0), (0, -1)) 
    dist = [[INF] * W for _ in range(H)]
    que = collections.deque()
    que.append((Ch, Cw, 0))
    dist[Ch][Cw] = 0
    while que:
        cy, cx, cost = que.popleft()
        for dy, dx in d:
            ny = cy + dy
            nx = cx + dx
            if 0 <= ny < H and 0 <= nx < W and S[ny][nx] == '.' and cost < dist[ny][nx] :
                dist[ny][nx] = cost
                que.appendleft((ny, nx, cost))
        for dy, dx in itertools.product(range(-2, 3), repeat=2):
            ny = cy + dy
            nx = cx + dx
            if 0 <= ny < H and 0 <= nx < W and S[ny][nx] == '.' and cost + 1 < dist[ny][nx] :
                dist[ny][nx] = cost + 1
                que.append((ny, nx, cost + 1))

    if dist[Dh][Dw] == INF:
        print(-1)
    else:
        print(dist[Dh][Dw])

if __name__ == '__main__':
    resolve()
### BUGGY CODE ###

x = int(input())

h = x//100

for a in range(0,h+1):
    for b in range(0,h+1):
        for c in range(0,h+1):
            for d in range(0,h+1):
                for e in range(0,h+1):
                    for f in range(0,h+1):
                        if 100*a+101*b+102*c+103*d+104*e+105*f==x:
                            print('1')
                            exit()
else:
    print('0')

### FIXED CODE ###

x = int(input())

l = -(-x//105)
h = x//100
fix = l*100

for b in range(0,h+1):
    for c in range(0,h+1):
        for d in range(0,h+1):
            for e in range(0,h+1):
                for f in range(0,h+1):
                    if fix + 1*b+2*c+3*d+4*e+5*f==x:
                        print('1')
                        exit()
else:
    print('0')
### BUGGY CODE ###

from heapq import heappop, heappush, heapify
def main():
    n, m = list(map(int, input().split()))
    A = list(map(int, input().split()))
    B = [list(map(int, input().split())) for _ in range(m)]
    heapify(A)
    B.sort(key = lambda x: x[1])
    for (b, c) in B:
        for i in range(b):
            a = heappop(A)
            heappush(A, max(a, c))
    print(sum(A))


if __name__ == '__main__':
    main()


### FIXED CODE ###

from heapq import heappop, heappush, heapify
def main():
    n, m = list(map(int, input().split()))
    A = list(map(int, input().split()))
    B = [list(map(int, input().split())) for _ in range(m)]
    heapify(A)
    B.sort(key = lambda x: x[1], reverse = True)
    for (b, c) in B:
        if c > A[0]:
            for i in range(b):
                a = heappop(A)
                heappush(A, max(a, c))
    print(sum(A))


if __name__ == '__main__':
    main()
### BUGGY CODE ###

vec = input().split(' ')
k = int(vec[0])
count = 0

for x in range(k + 1):
    for y in range(k + 1):
        z = int(vec[1]) - x - y
        if z >= 0 and z <= k:
            count += 1

print(count)

### FIXED CODE ###

vec = input().split(' ')
k = int(vec[0])
s = int(vec[1])
count = 0
for x in range(k + 1):
    if x <= s:
        for y in range(k + 1):
            if x + y <= s:
                z = s - x - y
                if z >= 0 and z <= k:
                    count += 1
            else: break
    else: break
print(count)
### BUGGY CODE ###

from fractions import gcd
N=int(input())
A=list(map(int,input().split(' ')))
ans = 0
l = 1
mod = 10**9+7
for i in A:
    g = gcd(l,i)
    l = l*i//g
for i in A:
    ans += l//i
    ans %=mod
print(ans)

### FIXED CODE ###

from fractions import gcd
N=int(input())
A=list(map(int,input().split(' ')))
ans = 0
l_1 = 1
l_2 = 1
mod = 10**9+7
def lcm(x,y):
    return x*y//gcd(x,y)
for i in A[:N//2]:
    l_1 = lcm(l_1,i)
for j in A[N//2:]:
    l_2 = lcm(l_2,j)
l = lcm(l_1,l_2)
out1 = sum([l_1//i for i in A[:N//2]])
out2 = sum([l_2//i for i in A[N//2:]])
out1 *= l//l_1
out2 *= l//l_2
print((out1+out2)%mod)
### BUGGY CODE ###



n,m = map(int,input().split())
s = list(input())
edges = [tuple(map(int,input().split())) for i in range(m)]


edgeset = set()
for i,j in edges:
    edgeset.add((min(i,j),max(i,j)))


def addEdge(graph,u,v):
    graph[u].add(v)


def deleteNode(graph,node):
    graph.pop(node,None)

from collections import defaultdict
graphAB = defaultdict(set)
graphABopp = defaultdict(set)

for i,j in edgeset:
    addEdge(graphAB,i,j)
    addEdge(graphABopp,j,i)



def adjAB(node):
    Aflag = 'A' in map(lambda x:s[x-1],graphAB[node])
    Aflag = Aflag or 'A' in map(lambda x:s[x-1],graphABopp[node])
    Bflag = 'B' in map(lambda x:s[x-1],graphAB[node])
    Bflag = Bflag or 'B' in map(lambda x:s[x-1],graphABopp[node])
    if Aflag and Bflag:
        return(True)
    else:
        return(False)



visitlist = [i for i in range(1,n+1) if not adjAB(i)]
#print(visitset)

while bool(visitlist):
    i = visitlist.pop()
    for j in graphAB[i]:
        graphABopp[j].remove(i)
        if not adjAB(j):
            visitlist.append(j)
            #print(visitset,'add')
    for j in graphABopp[i]:
        graphAB[j].remove(i)
        if not adjAB(j):
            visitlist.append(j)
            #print(visitset,'add')
    graphAB.pop(i,None)
    graphABopp.pop(i,None)

#print(graphAB)
#print(graphABopp)


if graphAB == {} and graphABopp == {}:
    print('No')
else:
    print('Yes')





### FIXED CODE ###

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
GC027 C
"""

n,m = map(int,input().split())
s = list(input())
edges = [tuple(map(int,input().split())) for i in range(m)]
ali = [0 for i in range(n)]
bli = [0 for i in range(n)]


def addEdge(graph,u,v):
    graph[u].add(v)


from collections import defaultdict
graphAB = defaultdict(set)

def incrementAB(node,adj):
    if s[adj-1] == 'A':
        ali[node-1]+=1
    if s[adj-1] == 'B':
        bli[node-1]+=1

def decrementAB(node,adj):
    if s[adj-1] == 'A':
        ali[node-1]-=1
    if s[adj-1] == 'B':
        bli[node-1]-=1

for i,j in edges:
    addEdge(graphAB,i,j)
    addEdge(graphAB,j,i)

def adjAB(node):
    if ali[node-1]!=0 and bli[node-1]!=0:
        return(True)
    else:
        return(False)

graphvers = set(graphAB.keys())
visitset = set()
for i in range(1,n+1):
    if not i in graphvers:
        s[i-1] = 'C'
    else:
        for j in graphAB[i]:
            incrementAB(i,j)
        if not adjAB(i):
            visitset.add(i)


while bool(visitset):
    #print(graphAB)
    #print(graphABopp)
    #print(abli)
    i = visitset.pop()
    for j in graphAB[i]:
        if s[j-1] != 'C':
            decrementAB(j,i)
            if not adjAB(j):
                visitset.add(j)
    s[i-1] = 'C'

#print(graphAB)
#print(graphABopp)

sset= set(s)
sset.add('C')
sset.remove('C')
if bool(sset):
    print('Yes')
else:
    print('No')
### BUGGY CODE ###

# -*- coding: utf-8 -*-

if __name__ == '__main__':
    S = input()
    count = 0

    while 'BW' in S:
        idx = S.index('BW')
        S = S[:idx] + 'WB' + S[idx + 2:]
        count += 1

    print(count)


### FIXED CODE ###

# -*- coding: utf-8 -*-

if __name__ == '__main__':
    S = input()

    W_count = S.count('W')
    idx, count, result = 0, 0, 0

    while count < W_count:
        if S[idx] == 'W':
            result += idx - count
            count += 1
        idx += 1

    print(result)
### BUGGY CODE ###

[A,B,N] = list(map(int,input().split()))

x=N
dammy=[]
while x > N//(1.5):
    dammy.append((A*x)//B - A * int(x/B))
    x = x -1
print(max(dammy))

### FIXED CODE ###

[A,B,N] = list(map(int,input().split()))

W = N//B
dammy=[]
x=N
dammy.append((A*x)//B - A * int(x/B))
x=(B * W)-1
dammy.append((A*x)//B - A * int(x/B))


print(max(dammy))
### BUGGY CODE ###

import sys
N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
for i in range(1, N + 1):
    print(A.count(i))

### FIXED CODE ###

import sys
import collections

N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
c = collections.Counter(A)
for i in range(1, N + 1):
    print(c[i])
### BUGGY CODE ###

N, P = map(int, input().split())

if N == 1:
    print(P)
else:
    ans = 1
    for x in range(1, int(P**(1/N))+10):
        if P % (x**N) == 0:
            ans = max(ans, x)
    print(ans)

### FIXED CODE ###

from collections import Counter

N, P = map(int, input().split())

# n以下の全ての素数のセットを返す関数
def prime_set(n):
    primes = set(range(2, n+1))
    for i in range(2, int(n**0.5) + 1):
        primes.difference_update(range(i*2, n+1, i))
    return primes

# nを素因数分解して素因数の全リストを返す関数
def prime_factors(n):
    f = []
    for i in prime_set(int(n**0.5) + 1):
        while n % i == 0:
            f.append(i)
            n //= i
    if n > 1:
        f.append(n)
    return f

c = Counter(prime_factors(P))
ans = 1

for x in c.keys():
    ans *= pow(x, int(c[x]//N))

print(ans)
### BUGGY CODE ###


n,m=map(int,input().split())
#print(n,m)
a=m//n
for i in range (a,0,-1):
    if m%i==0:
        print(i)
        break

### FIXED CODE ###

from math import sqrt

n,m=map(int,input().split())
#print(n,m)
l=[]
for i in range(1,int(sqrt(m))+1):
    if m%i == 0:
        l.append(i)
        l.append(m//i)
l.sort(reverse=True)
for i in l:
    if i*n<=m:
        print(i)
        break
### BUGGY CODE ###

N=int(input())
import math

for i in range(1,N+1):
    ans=0
    for x in range(1,33):
        x2=x*x
        for y in range(1,x+1):
            a=-(3*(x2)+3*(y*y)+2*x*y)/4+i
            if a>0:
                b=(math.sqrt(a)-(x+y)/2)
                if b>0 and b%1==0.0:
                    if x==y:
                        ans+=1
                    else:
                        ans+=2

    print(ans)


### FIXED CODE ###

N=int(input())
li=[0]*N
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            temp=x**2+y**2+z**2+x*y+y*z+z*x
            if temp<=N:
                li[temp-1]+=1
for i in range(N):
    print(li[i])
### BUGGY CODE ###

class Daise:
    def __init__(self, info_list):
        self.T = info_list[0]
        self.S = info_list[1]
        self.E = info_list[2]
        self.W = info_list[3]
        self.N = info_list[4]
        self.B = info_list[5]
    
    def change(self, axis):
        if axis == 'S':
            self.T, self.B, self.S, self.N = self.N, self.S, self.T, self.B
        
        elif axis == 'E':
            self.T, self.B, self.E, self.W = self.W, self.E, self.T, self.B
        
        elif axis == 'W':
            self.T, self.B, self.W, self.E = self.E, self.W, self.T, self.B
        
        elif axis == 'N':
            self.T, self.B, self.N, self.S = self.S, self.N, self.T, self.B
        
        elif axis == 'Turn':
            self.S, self.E, self.N, self.W = self.E, self.N, self.W, self.S
    
    def output(self):
        return [self.T, self.S, self.E, self.W, self.N, self.B]


if __name__ == '__main__':
    daiseA = Daise(list(map(str, input().split())))
    daiseB = Daise(list(map(str, input().split())))

    while daiseA.T != daiseB.T:
        daiseB.change('S')
        daiseB.change('S')
        daiseB.change('Turn')   
    
    while daiseA.S != daiseB.S:
        daiseB.change('Turn')
    
    if daiseA.output() == daiseB.output():
        print("Yes")
    else: 
        print('No')


### FIXED CODE ###

import sys


class Daise:
    def __init__(self, info_list):
        self.T = info_list[0]
        self.S = info_list[1]
        self.E = info_list[2]
        self.W = info_list[3]
        self.N = info_list[4]
        self.B = info_list[5]
    
    def change(self, axis):
        if axis == 'S':
            self.T, self.B, self.S, self.N = self.N, self.S, self.T, self.B
        
        elif axis == 'E':
            self.T, self.B, self.E, self.W = self.W, self.E, self.T, self.B
        
        elif axis == 'W':
            self.T, self.B, self.W, self.E = self.E, self.W, self.T, self.B
        
        elif axis == 'N':
            self.T, self.B, self.N, self.S = self.S, self.N, self.T, self.B
        
        elif axis == 'Turn':
            self.S, self.E, self.N, self.W = self.E, self.N, self.W, self.S
    

    def output(self):
        return [self.T, self.S, self.E, self.W, self.N, self.B]
    

    def set_info(self, top, front):
        if front in (self.T, self.B):
            self.change("S")

        while self.S != front:
            self.change('Turn')
 
        while self.T != top:
            self.change('E')



if __name__ == '__main__':
    daiseA = Daise(list(map(str, input().split())))
    daiseB = Daise(list(map(str, input().split())))
    
    for _ in range(4):
        for _ in range(4):
            if daiseA.output() == daiseB.output():
                print('Yes')
                sys.exit()
            for _ in range(4):
                if daiseA.output() == daiseB.output():
                    print('Yes')
                    sys.exit()
                daiseB.change('Turn')
            daiseB.change('S')
        daiseB.change('W')
    print('No')
### BUGGY CODE ###

n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]

for i in range(1, n+1):
    tmp = a.count(i)
    if k+tmp-q > 0:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

from collections import defaultdict
n, k, q = map(int, input().split())
d = defaultdict(int)
for i in range(q):
    tmp = int(input())
    d[tmp] += 1

for i in range(1, n+1):
    if k+d[i]-q > 0:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))

def f(n,m):
  tmp=[]
  for i in range(n,m+1):
    if i%n==0:
      tmp.append(i)
  return tmp
def ff(arr_1):
  tmp=0
  for i in arr_1:
    tmp+=b[i-1]
  tmp = tmp%2
  return tmp
b = [0]*n
for i in range(n-1,-1,-1):
  num = f(i+1,n)
  if len(num)==1:
    b[i] = a[i]
  else:
    if ff(num[1:])==a[i]:
      b[i]=0
    else:
      b[i]=1
print(sum(b))
ans=""
for i in range(n):
  if b[i]==1:
    ans+=str(i+1)+" "
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = [0]*n
tmp=[]
ans=""
for i in range(n-1,-1,-1):
  num = i+1
  total=0
  j=1
  while (i+1)*j <= n:
    total+=b[((i+1)*j)-1]
    j+=1  
  if total%2==a[i]:
    b[i]=0
  else:
    b[i]=1
    tmp.append(i+1)

print(sum(b))
print(str(sorted(tmp)).replace(',','').replace('[','').replace(']',''))
### BUGGY CODE ###

MOD = 2019
L, R = map(int, input().split())

ans = float('inf')
for i in range(L,R):
    for j in range(i+1,R+1):
        if i%MOD==0 or j%MOD==0:
            ans = min(ans,(i*j)%MOD)
            break
        ans = min(ans,(i*j)%MOD)
print(ans)

### FIXED CODE ###

MOD = 2019
L, R = map(int, input().split())

if R - L > 2019:
    print(0)
    exit()

ans = float('inf')
for i in range(L,R):
    for j in range(i+1,R+1):
        ans = min(ans,(i*j)%MOD)
print(ans)
### BUGGY CODE ###

A, B = map(int, input().split())

xor = 0
for i in range(A, B+1):
    xor = xor ^ i
print(xor)

### FIXED CODE ###

A, B = map(int, input().split())

def f(x):
    # 下2桁が00,01,10,11となる連続する数のxorは消滅するので考えなくてよい
    xi = (x >> 2) << 2
    xlsb2 = x & 0x3

    if xlsb2 == 0:
        return(xi)
    elif xlsb2 == 1:
        return(1)
    elif xlsb2 == 2:
        return(xi + 3)
    else:
        return(0)

print(f(A-1) ^ f(B))
### BUGGY CODE ###

import collections

n = int(input())

l = [input() for i in range(n)]

c = collections.Counter(l)

max_list = [kv[0] for kv in c.items() if kv[1] == max(c.values())]
max_list.sort()
for i in range(len(max_list)):
    print(max_list[i])

### FIXED CODE ###

n = int(input())
l = [input() for i in range(n)]
d={}

for i in range(len(l)):
    if l[i] in d:
        d[l[i]]+=1
    else:
        d[l[i]]=1

largest=max(d.values())
ans=[]
for key in d.keys():
    if d[key]==largest:
        ans.append(key)
ans=sorted(ans)
for word in ans:
    print(word)
### BUGGY CODE ###

n, m = map(int, input().split())

def solve():
    res = 1
    for i in range(1, m//n+1):
        if m % i == 0:
            if (m // i) >= n:
                res = max(res, i)
    print(res)

solve()


### FIXED CODE ###

n, m = map(int, input().split())

def solve():
    res = 1
    for i in range(m//n+1, 0, -1):
        if m % i == 0:
            if (m // i) >= n:
                res = i
                break
    print(res)

solve()
### BUGGY CODE ###

N = int(input())

def ryuka(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1
    else:
        return ryuka(n-1) + ryuka(n-2)

print(ryuka(N))

### FIXED CODE ###

N = int(input())
a = 2
b = 1

for i in range(N):
    c = a + b
    a = b
    b = c

print(a)