Harryxun/stf_run huggingface dataset:
L, R = map(int, input().split())
from itertools import combinations

mod = 2019
mini = mod - 1
for i, j in combinations(range(L, R+1), 2):
    i, j = i%mod, j%mod
    mini = min(mini, i*j % mod)
    if mini == 0:
        break
print(mini)

### FIXED CODE ###

L, R = map(int, input().split())
from itertools import combinations

mod = 2019

if R - L >= mod:
    print(0)
else:
    mini = mod - 1
    for i, j in combinations(range(L, R+1), 2):
        mini = min(mini, i*j % mod)
        if mini == 0:
            break
    print(mini)
import collections
S = input()
cnt = 0

mod = [0]
reverse_S = S[::-1]
for i in range(len(reverse_S)):
  now = int(reverse_S[i]) * pow(10,i,2019)
  mod.append((now + mod[i]) % 2019)

c = collections.Counter(mod)
hindo = sorted(c.values(),reverse=True)

for i in range(hindo.index(1)):
  n = hindo[i]
  cnt += n*(n-1)//2

print(cnt)

### FIXED CODE ###

import collections
S = input()
cnt = 0

mod = [0]
reverse_S = S[::-1]
for i in range(len(reverse_S)):
  now = int(reverse_S[i]) * pow(10,i,2019)
  mod.append((now + mod[i]) % 2019)


c = collections.Counter(mod)
hindo = c.values()
for i in hindo:
  if i != 1:
    cnt += i*(i-1)//2


print(cnt)
N = int(input())
 
ans = -1
for i in range(N):
	if round(i*1.08) == N:
    	ans = i
      
if ans == -1:
	print(':(')
  
else:
	print(ans)

### FIXED CODE ###

import math

N = int(input())
ans = -1
for i in range(N+1):
	if math.floor(i*1.08) == N:
		ans = i
if ans == -1:
	print(':(')
else:
	print(ans)
import numpy as np

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

a_sort = np.sort(a)
b_sort = np.sort(b)

# 1. 回数関係なくそもそも不可能なやつ → no
# 2-a. サイクルは1つだとしても，完璧じゃない組み合わせが1つ以上許容されるやつ → yes
# 2-b. サイクルが2以上にわけられるやつ → yes

# 1
if (a_sort > b_sort).any():
    print('No')
    exit()

# 2-a
if (a_sort[1:] <= b_sort[:-1]).any():
    print('Yes')
    exit()

# 2-b （startをとりあえず1とかにする）
d = dict(zip(a,b))
from_ = 1
count = 0
while True:
    count += 1
    from_ = d[from_]
    if from_ == 1:
        break

if count != n:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

import numpy as np

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

a_sort = np.sort(a)
b_sort = np.sort(b)

# 1. 回数関係なくそもそも不可能なやつ → no
# 2-a. サイクルは1つだとしても，完璧じゃない組み合わせが1つ以上許容されるやつ → yes
# 2-b. サイクルが2以上にわけられるやつ → yes

# 1
if (a_sort > b_sort).any():
    print('No')
    exit()

# 2-a
if (a_sort[1:] <= b_sort[:-1]).any():
    print('Yes')
    exit()

# 2-b （startをとりあえず0番目とかにする）
index = b.argsort()
a = a[index]
sort_dict = a.argsort().tolist()
from_ = 0
count = 0
while True:
    count += 1
    from_ = sort_dict[from_]
    if from_ == 0:
        break

if count != n:
    print('Yes')
else:
    print('No')
x = np.array(input().split(' '), int)
print(x[1:].min(),' ', 0 if x[0] >= x[1:].sum() else x[1:].sum() - x[0])

### FIXED CODE ###

import numpy as np
x = np.array(input().split(' '), int)
print(x[1:].min(),' ', 0 if x[0] >= x[1:].sum() else x[1:].sum() - x[0])
L = list(map(int, input().split().split()))

if L[0] == L[1] == L[2]:
    print("no")
else:
    print("yes")

### FIXED CODE ###

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

if a==b and a!=c:
    print("Yes")
elif a==c and a!=b:
    print("Yes")
elif b==c and b!=a:
    print("Yes")
else:
    print("No")
# -*- coding: utf-8 -*-
import math
from functools import reduce

def gcd(numbers):
    return reduce(math.gcd, numbers)

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

g_max = 1
for i in range(n):
    d = a_l.pop(0)
    g = gcd(a_l)
    # print(g)
    g_max = max(g, g_max)
    # print(d)
    a_l.append(d)

print(g_max)

### FIXED CODE ###

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

# 最大公約数
def gcd(a,b):
    if b==0:return a
    return gcd(b,a%b)

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

# 累積GCD
left = [0]*(n+1)
right = [0]*(n+1)
for i in range(n):
    left[i+1] = gcd(left[i], a[i])
for i in reversed(range(n)):
    right[i] = gcd(right[i+1], a[i])

# print(left)
# print(right)

# 集計
ans = 0
for i in range(n):
    l = left[i]
    r = right[i+1]
    ans = max(ans, gcd(l, r))

print(ans)
N = int(input())

A = [int(i) for i in input().split()]

count = 0
for i in range(N-1):
    for j in range(i+1, N):
        if abs(i-j) == a[i] + a[j]:
            count += 1
            
print(count)

### FIXED CODE ###

import collections
N = int(input())

A = [int(i) for i in input().split()]

plus = [0] * (N-1)
for i in range(N-1):
  plus[i] = i + A[i]

minus = [0] * (N-1)
for j in range(1, N):
  minus[j-1] = j - A[j]

sum = 0
c = dict(collections.Counter(minus))
for i in range(N-1):
  sum += c.get(plus[i], 0)
  c[minus[i]] -= 1

print(sum)
x = input()
print(["Yes","No"][x == "AAA" | x == "BBB"])

### FIXED CODE ###

x = input()
print(["Yes","No"][(x == "AAA") | (x == "BBB")])
x = input()
y = input()
return x * y

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
import sys

N = int(sys.stdin.readline())
A = tuple(map(int, sys.stdin.readline().split()))
B = []
ans = 0
for i in A:
    B.append(list(bin(i)[2:]))
C = (0 for i in range(60))
for i in B:
    for l in range(len(i)):
        if i[-(l+1)] == '1':
            C[l] += 1
for i in range(60):
    ans = (ans + C[i]*(N-C[i])*(2**i))%(10**9+7)
print(ans)

### FIXED CODE ###

import sys
mod = 10**9+7
N = int(sys.stdin.readline())
A = tuple(map(int, sys.stdin.readline().split()))
B = []
ans = 0
C = [0 for i in range(60)]
for i in A:
    for l in range(60):
        if ((i >> l) & 1) == 1:
            C[l] += 1
for i in range(60):
    t = C[i]
    ans = (ans + t*(N-t)*(2**i)) % mod
print(ans)
import sys
N, M, K = [int(x) for x in input().split()]
A = [float(x) for x in input().split()]
B = [float(x) for x in input().split()]
 
AB = list()
a = 0
b = 0
for i in range(N+M):
  if ((a < N) and (b < M)):
    if(A[a] == B[b]):
      AB.append(A[a])
      a += 1
      AB.append(B[b])
      b += 1
    elif(A[a] < B[b]):
      AB.append(A[a])
      a += 1
    else:
      AB.append(B[b])
      b += 1
  elif(a == N):
    for j in range(M-b):
      AB.append(B[b])
      b += 1
    break
  elif(b == M):
    for j in range(N-a):
      AB.append(A[a])
      a += 1
    break
    
ans = 0
K = float(K)
while K >= 0:
  K -= AB[ans]
  ans += 1
  if((ans == (N+M)) and (K > 0)):
    print(N+M)
    sys.exit()
  
print(ans-1)

### FIXED CODE ###

import sys
import numpy as np
N, M, K = [int(x) for x in input().split()]
A = [float(x) for x in input().split()]
B = [float(x) for x in input().split()]
a = [0]
b = [0]
for i in range(N):
  a.append(A[i] + a[i])
for i in range(M):
  b.append(B[i] + b[i])
ans, j = 0, M
for i in range(N+1):
  if(a[i]>K):
    break
  while b[j] > K - a[i]:
    j -= 1
  ans = max(ans, i+j)
print(ans)
H,W=int(input()).split()
h,w=int(input()).split()
print((H-h)*(W-w))

### FIXED CODE ###

H,W=map(int,(input()).split())
h,w=map(int,(input()).split())
print((H-h)*(W-w))
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
i = 0
cnt = 0
while D <= X:
  D += L[i]
  i += 1
  cnt += 1
print(cnt)

### FIXED CODE ###

N, X = map(int, input().split())
L = list(map(int, input().split()))
D = [0]
cnt = 1
for i in range(1,N+1):
  D.append(D[i-1]+L[i-1])
  if X >= D[i]:
    cnt += 1
print(cnt)
N,M = map(int,input().split())
count = 0
while(1):
    if N>=1:
        if M>=2:
            N -= 1
            M -= 2
            count += 1
        else:
            break
    else:
        while(1):
            if M >= 4 :
                M -= 4
                count += 1
            else:
                break
        break
        
print(count)


### FIXED CODE ###

N = int(input())
x = 0
y = 0
for i in range(1,N+1):
    x += 800
    if (i%15 == 0):
        y += 200
print(x-y)
N, M, C = map(int, input().split())
Blis = [int(x) for x in input().split()]
Alis = [x for x in range(N)]
k = 0
for i in range(N):
  Alis[i] = [int(x) for x in input().split()]
for i in range(N):
  total = 0
  for j in range(M):
    total = total + (Alis[i][j])*(Blis[i][j])
  total = total + C
  if total > 0:
    k = k + 1
print(k)   

### FIXED CODE ###

N, M, C = map(int, input().split())
Blis = [int(x) for x in input().split()]
k = 0
for i in range(N):
  Alis = [int(x) for x in input().split()]
  total = 0
  for j in range(M):
    total = total + (Alis[j])*(Blis[j])
  total = total + C
  if total > 0:
    k = k + 1
print(k)
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = A[i] - i
sorted(A)
halfN = int(N/2)
x = 0
list = []
for j in range(-1,2):
    for i in range(N):
        x = x + abs(A[i] - A[halfN+j])
    list.append(x)
    x = 0
print(min(list))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = A[i] - i - 1
A = sorted(A)
medN = N//2

x = 0
for i in range(N):
    x = x + abs(A[i] - A[medN])
print(x)
r = input()
r1 = 1

print( r**2 )

### FIXED CODE ###

r = int(input() )
print(r*r)
import copy

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

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

B =[]
C =[]

tA = []
ans = sum(A)

for i in range(M):
    b,c = map(int,input().split())
    B.append(b)
    C.append(c)

for i in range(N):
    for j in range(M):
        tA = copy.copy(A)
        for k in range(B[j]):
            if tA[i] < C[k]:
                tA[i] = C[k]
        if sum(tA) > ans:
            ans = sum(tA)

print (ans)


### FIXED CODE ###


#AのリストにCのリストを加えて大きい順に並べ替えてNまでの和を求める
N,M = map(int,input().split())

#Aの入力
A_list = list(map(int,input().split()))

C_list = []

#Cのリストに追加する
for i in range(M):
    bi,ci = map(int,input().split())
    C_list.append([bi,ci])

#C_listをCの値でソート
C_list=sorted(C_list, reverse=True, key=lambda x:x[1])

count = 0
for bi,ci in C_list:
    count += bi
    if count > N:
        #countがNより大きくなったらNより大きくなった分だけ使う
        bi = N - count + bi
    A_list.extend([ci]*bi)

#A_Listを大きい順に並べ替える
A_list=sorted(A_list,reverse=True)

#N番目までの総和を求める
print(sum(A_list[0:N]))
while True:
    try:
        a, b, c = map(int, input().split())
    except:
        break
    l=[True] * 11
    l[a] = l[b] = l[c] = False
    sum = a + b
    over = 0

    fpr i in range(1,11):
        if l[i]:
            if sum + i >= 20:
                over += 1

    if over / 7 < 0.5:
        print("YES")
    else:
        print("NO")

### FIXED CODE ###

while True:
    try:
        a, b, c = map(int, input().split())
    except:
        break

    l=[True] * 11
    l[a] = l[b] = l[c] = False
    sum = a + b
    over = 0

    for i in range(1,11):
        if l[i]:
            if sum + i > 20:
                over += 1

    if over / 7 < 0.5:
        print("YES")
    else:
        print("NO")
s = input()
ss = []

key = s[0]
cnt = 1
for i in range(1,len(s)):
    if key == s[i]:
        cnt += 1
    else:
        ss.append(cnt)
        key = s[i]
        cnt = 1

ss.append(cnt)

ans = 0
maxs = max(ss)
#print(ss)
# 端かどうかの判定。端ならそのまま。
if len(ss)==1 or len(ss)==2:
    ans = maxs
elif max(ss[1:len(ss)-2]) < maxs and ss[0] != ss[len(ss)-1]:
    ans = maxs
# 端じゃないなら、隣の長いほうも入る。
# 但し、とろうとしている長いのが端なら、短いほうしか入れられない。
else:
    tmpmax = 0
    print(ss)
    for i in range(1,len(ss)-1 ):
        if ss[i] == maxs:
            if i == 1:
                if ss[0] > ss[2]:
                    tmp = maxs + ss[2] 
                else:
                    tmp = maxs + ss[0]
            elif i == len(ss)-2:
                if ss[len(ss)-1] > ss[len(ss)-3]:
                    tmp = maxs + ss[len(ss)-3]
                else:
                    tmp = maxs + ss[len(ss)-1]
            else:
                tmp= maxs+max(ss[i-1],ss[i+1])

            if tmp > tmpmax:
                tmpmax = tmp
        else:
            pass

    ans = tmpmax

print(ans)


### FIXED CODE ###

import math

s = input()
minpos = len(s)

for i in range(1,len(s)):
    if s[i] != s[i-1]:
        pos = max(i,len(s)-i)

        if pos < minpos:
            minpos = pos

print(minpos)
i=0
 while 1:
  x = int(raw_input())
  if x == 0:
   break
  i+=1
  print "Case %d: %d" % (i,x)
 

### FIXED CODE ###

sum = 0
while 1:
   x = int(raw_input())
   sum = sum + 1
   if x == 0:
      break
   print 'Case %s: %s' %(sum, x)
def find(tab, a):
    try:
        if tab[0][a]==-1:
            return a
        tab[0][a] = find(tab, tab[0][a])
        return tab[0][a]
    except:
        pass

def union(tab, a, b):
    p1, p2 = find(tab, a), find(tab, b)
    if p1 != p2:
        tab[0][p1] = p2
        tab[1][p2] += tab[1][p1]

def size(tab, a):
    return tab[1][a]

N, M = [int(a) for a in input().split(" ")]
ABs = [[int(a) for a in input().split(" ")] for i in range(M)]
tab = [[-1]*N, [1]*N]
arr = []



for a, b in reversed(ABs):
    a, b = a-1, b-1
    pa, pb = find(tab, a), find(tab, b)
    na, nb = size(tab, pa), size(tab, pb)
    if pa!=pb:
        dn = ((na+nb)*(na+nb-1)//2)-(na*(na-1)//2)-(nb*(nb-1)//2)
        arr.append(dn)
        union(tab, a, b)
    else:
        arr.append(0)

acc = 0
for cp in reversed(arr):
    acc += cp
    print(acc)


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

def find(tab, a):
    if tab[0][a]==a:
        return a
    tab[0][a] = find(tab, tab[0][a])
    return tab[0][a]

def union(tab, a, b):
    p1, p2 = (find(tab, a), find(tab, b))
    if p1 != p2:
        tab[0][p1] = p2
        tab[1][p2] += tab[1][p1]

def size(tab, a):
    return tab[1][a]

N, M = [int(a) for a in input().split(" ")]
ABs = [[int(a) for a in input().split(" ")] for i in range(M)]
tab = [[i for i in range(N)], [1 for i in range(N)]]
arr = []

for a, b in reversed(ABs):
        a, b = (a-1, b-1)
        pa, pb = (find(tab, a), find(tab, b))
        na, nb = (size(tab, pa), size(tab, pb))
        if pa!=pb:
            dn = ((na+nb)*(na+nb-1)//2)-(na*(na-1)//2)-(nb*(nb-1)//2)
            arr.append(dn)
            union(tab, a, b)
        else:
            arr.append(0)

acc = 0
for cp in reversed(arr):
    acc += cp
    print(acc)
a,b = map(int, input().split())
x = []
m =19999999999999
for i in range(a):
    ta , tb = map(int, input().split()) 
    x.append([ta,tb])
for i in range(b):
    ta , tb = map(int, input().split()) 
    for x,y in x:
        m = min(m,abs(x-ta)+abs(y-tb))
    print(m)

### FIXED CODE ###

n,m=map(int,input().split())
p=[list(map(int,input().split()))for _ in range(n)]
s=[list(map(int,'0'*m))for _ in range(n)]
for j in range(m):
  c,d=map(int,input().split())
  for i in range(n):
    s[i][j]=abs(p[i][0]-c)+abs(p[i][1]-d)
else:
  for i in range(n):print(1+s[i].index(min(s[i])))
import numpy as np
import scipy.linalg as linalg

n = int(input())
b = [[int(i)] for i in input().split()]

diag = [.5 for i in range(n)]

A = np.diag(diag)
for i in range(n-1):
  A[i][i+1] = .5

A[n-1][0] = .5

invA = np.linalg.pinv(A)
x = np.dot(invA, b)

tmp = [str(int(round(i[0], 0))) for i in x]
print(' '.join(tmp))


### FIXED CODE ###

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

all_ = sum(a)

x1 = all_ - 2 * (sum([a[i] for i in range(1, n, 2)]))
x = [x1]

for i in range(1, n):
  x_i = 2 * a[i-1] - x[i-1]
  x.append(x_i)

print(' '.join(list(map(str, x))))
a,b = map(int,input().split())
i=0
if b!=1:



    while True:
        if a + (a-1)*i < b:
            i+=1
        else :
            break

print(i)

### FIXED CODE ###

S = input()
T = input()
ans=0
for i in range (3):
	if(S[i] == T[i]):
  		ans+=1
print(ans)
S = input()
if S = "Sunny":
  print("Cloudy")
if S = "Cloudy":
  print("Rainy")
else:
  print("Sunny")

### FIXED CODE ###

S = input()
if S == "Sunny":
  print("Cloudy")
elif S == "Cloudy":
  print("Rainy")
else:
  print("Sunny")
a = int(input())
b = int(input())
if 1<=a<=100 and 1<=b<=100:
  print(a*b)

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
import math

a, b, h, m = list(map(int, input().split()))

if m == 0:
	m = 60
if h == 0
	h = 12

if h/12 > m/60:
	k = (h/12 - m/60) * 360
elif h/12 < m/60:
	k = (m/60 - h/12) * 360
else:
	print(0)
	exit()
print(math.sqrt((a**2) + (b**2) - (2 * a * b * math.cos(math.radians(k)))))


### FIXED CODE ###

N = input()

if int(N[-1]) in [2,4,5,7,9]:
	print('hon')
elif int(N[-1]) in [0,1,6,8]:
	print('pon')
else:
	print('bon')
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**9]*n
dp[0]=0
for i in range(n-1):
    for j in range(i+1,min(i+k+1,n)):
        dp[j]=min(dp[j],dp[i]+abs(h[j]-h[i]))
print(dp[-1])

### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
dp=[10**9]*n
dp[0]=0
dp[1]=abs(h[1]-h[0])
for i in range(n-1):
    dp[i+1]=min(dp[i+1],dp[i]+abs(h[i+1]-h[i]))
    if i+2<n:
        dp[i+2]=min(dp[i+2],dp[i]+abs(h[i+2]-h[i]))
print(dp[-1])
n = raw_input()
A = map(int, raw_input().split())
q = raw_input()
m = map(int, raw_input().split())

def solve(i, m):
 if i == m:
  return true
 if i > n:
  return false
 res = solve(i + 1, m) or solve(i + 1, m - A(i))
 return res
 
for j in range(0, q):
 if m == solve(0, m(j)):
  print "yes"
 else:
  print "no"

### FIXED CODE ###

n = input()
A = map(int, raw_input().split())
q = input()
m = map(int, raw_input().split())

def solve(i, m):
 if m == 0:
  return True
 if i >= n or m > sum(A):
  return False
 res = solve(i+1, m) or solve(i+1, m-A[i])
 return res

for j in range(0, q):
 if solve(0, m[j]):
  print 'yes'
 else:
  print 'no'
R,G=map(int,input().split())
print(2*G-R)

### FIXED CODE ###

R=int(input())
G=int(input())
print(2*G-R)
N, M, C = list(map(int, input().split()))
B = list(map(int, input().split())
A = []
 
for i in range(N):
 A.append(list(map(int, input().split())
 
def main():
cnt = 0
for i in range(N):
 val = C
 for j in range(M):
  val += A[i][j] * B[j]
  if val > 0:
  cnt += 1
return cnt
print(main)

### FIXED CODE ###

# coding: utf-8
# Your code here!
H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))
import numpy as np
n, m = map(int,input().split())
c = np.zeros(n)
for i in range(m)
    a, b = map(int,input().split())
    c[a-1] + 1
    c[b-1] + 1
for i in c:
    print(i)

### FIXED CODE ###

n, m = map(int,input().split())
c = [0 for i in range(n)]
for i in range(m):
    a, b = map(int,input().split())
    c[a-1] += 1
    c[b-1] += 1
for i in range(n):
    print(c[i])
from math import gcd
def lcm(a, b):
    return a * b // gcd(a, b)

n = int(input())
g = int(input())
for _ in range(n-1):
    t = int(input())
    g = lcm(g, t)
print(g)


### FIXED CODE ###

from fractions import gcd
def lcm(a, b):
    return a * b // gcd(a, b)

n = int(input())
g = int(input())
for _ in range(n-1):
    t = int(input())
    g = lcm(g, t)
print(g)
X = input()
tmp = int(X[-2] + X[-1])

iteration = 0

for i in range(5, 0, -1):
    iteration = tmp // i
    tmp %= i
    
    if tmp == 0:
        break

if (iteration * 100) >= int(X):
    print(1)
else:
    print(0)

### FIXED CODE ###

X = int(input())
c = X // 100

if (c * 100) <= X <= (c * 105):
    print(1)
else:
    print(0)
n = int(input())

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

if(len(a) >2):
  result = sum(b) + sum(c) - c[a[-1]-1]
  print(result)
else:
  result = sum(b) + c[0]
  print(result)


### FIXED CODE ###

n = int(input())

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

before = -100
result = sum(b)

for i in a:
  if(i == before+1):
    result += c[before-1]
  before = i
  
print(result)
s = int(input())
print(s.count(1))

### FIXED CODE ###

s = input()
print(s.count('1'))
N = int(input())
counter = 0
for i in range(N)
	l,n = map(int,input().split())
 	counter += (n - l + 1)
print(counter)

### FIXED CODE ###

N = int(input())
counter = 0
for i in range(N):
 l,n = map(int,input().split())
 counter += (n-l+1)
print(counter)
s = input()
a = ""
for i in range(len(s+1)//2):
  a += s[2*i]
print(a)

### FIXED CODE ###

s = input()
a = ""
for i in range((len(s)+1)//2):
  a = a+ str(s[2*i])
print(a)
class UnionFind:
    def __init__(self, n):
        self.parent = [-1] * n
        self.size = [1] * n
    def find(self, x):
        if self.parent[x] == -1:
            return x
        else:
            a = self.find(self.parent[x])
            self.parent[x] = a
            return a
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            self.parent[x] = y
            self.size[y] += self.size[x]
    def get_size(self, x):
        return self.size[self.find(x)]
    def printout(self):
        print(self.parent)
        print(self.size)

N, M, K = map(int, input().split())
uf = UnionFind(N)

ab = [[int(i)-1 for i in input().split()] for j in range(M)]
cd = [[int(i)-1 for i in input().split()] for j in range(K)]

for a, b in ab:
    uf.union(a, b) #RE

ans =[uf.get_size(i)-1 for i in range(N)]

for a, b in ab:
    ans[a] -= 1
    ans[b] -= 1

for c, d in cd:
    if uf.find(c) == uf.find(d):
        ans[c] -= 1
        ans[d] -= 1

print(*ans)

### FIXED CODE ###

import sys #追加
sys.setrecursionlimit(500*500) #追加

class UnionFind:
    def __init__(self, n):
        self.parent = [-1] * n
        self.size = [1] * n
    def find(self, x):
        if self.parent[x] == -1:
            return x
        else:
            a = self.find(self.parent[x])
            self.parent[x] = a
            return a
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            self.parent[x] = y
            self.size[y] += self.size[x]
    def get_size(self, x):
        return self.size[self.find(x)]
    def printout(self):
        print(self.parent)
        print(self.size)

N, M, K = map(int, input().split())
uf = UnionFind(N)

ab = [[int(i)-1 for i in input().split()] for j in range(M)]
cd = [[int(i)-1 for i in input().split()] for j in range(K)]

for a, b in ab:
    uf.union(a, b) #RE

ans =[uf.get_size(i)-1 for i in range(N)]

for a, b in ab:
    ans[a] -= 1
    ans[b] -= 1

for c, d in cd:
    if uf.find(c) == uf.find(d):
        ans[c] -= 1
        ans[d] -= 1

print(*ans)
import math
a,b,x = map(int,input().split())
if a*a*b/2 <x:
    #台形のパターン
    tan = (a*a*a)/(-2*x+2*b*a*a)
    print(math.atan(tan))
else:
    tan = 2*x/(a*b*b)
    print(math.atan(tan))

### FIXED CODE ###

#!/usr/bin/env python3
#input
import math
# math.degrees(theta) = theta radian to kodo
# math.atan(math.tan(theta)) = theta
a,b,x = map(int,input().split())
if x <= a*a*b/2:
    tan = (a*b*b)/(2*x)
else:
    tan = 2*(a*a*b-x)/(a**3)
print(math.degrees(math.atan(tan)))
N,M,C=map(int,input().split())
B=list(map(int,input().split()))
A=[]
for i in range(N):
  A.append([int(i) in i for input().split()])
ans=0
for a in A:
  asum=0
  for i in range(M):
    asum+=A[i]+B[i]
  asum+=C
  if asum > 0:
    ans+=1
print(ans)

### FIXED CODE ###

N,M,C=map(int,input().split())
B=list(map(int,input().split()))
A=[]
for i in range(N):
  A.append([int(i) for i in input().split()])
ans=0
for a in A:
  asum=0
  for i in range(M):
    asum += a[i]*B[i]
  asum+=C
  if asum > 0:
    ans+=1
print(ans)
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

import numpy as np

L, R = map(int, input().split())
k = np.arange(L, R + 1, dtype=np.int64)
k = k % 2019
# print(k)
# print(sorted(k))
print(k[0] * k[1])









# def main():

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


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

L, R = map(int, input().split())
if (R - L) > 3000:
    print(0)
    exit()
else:
    ans = 2019
    for i in range(L, R):
        for j in range(i + 1, R + 1):
            ans = min(ans, (i * j) % 2019)
    print(ans)