peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    x = [int(i) for i in input().split()]
    y = [int(i) for i in input().split()]

    if min(y) > max(x):
        print("No War")
    else:
        print("War")
# Judge status: Accepted
import math
n = int(input())
ans = 0
for i in range(1, n):
    ans +=int((n-1)/i)
print(ans)
# Judge status: Wrong Answer
x = str(input())
l = [x[0], x[1], x[2], x[3]]
m = [int(s) for s in l]
N = 2 ** 3
for i in range(N):
  n = [m[0], 0, 0, 0]
  o = [] # +か-かを記憶
  for j in range(3):
    if (i >> j) & 1:
      n[-j-1] = -m[-j-1]
      o.append('-')
    else:
      n[-j-1] = m[-j-1]
      o.append('+')
  if sum(n) == 7:
    print(str(m[0]) + o[0] + str(m[1]) + o[1] + str(m[2]) + o[2] + str(m[3]))
    exit()
# Judge status: Accepted
r,g,b=map(int,input().split())
print("YES" if (100*r+10*g+b)%4==0 else "NO")
# Judge status: Accepted
n = int(input())
ls = list(map(int,input().split()))
a = [0 for j in range(n)]
for i in range(n):
    a[i] = [ls[i],str(i+1)]
a.sort()
for k in range(n):
    print(a[k][1],end=' ')
# Judge status: Wrong Answer
n, c, k = map(int, input().split())

t = [0] * n
for i in range(n):
    t[i] = int(input())
t = sorted(t)
ans = 0
i = 0
while i < n:
    j = 0
    while i + j < n and t[i + j] < t[i] + k:
        j += 1
    i += j
    ans += 1 
print(ans)
# Judge status: Wrong Answer
N = int(input())
ls = list(map(int, input().split()))
 
size = len(ls)
 
ans = 0
for i in range(size - 1):
  gou = sum(ls[i+1:size])
  ans = ans + (gou * i)%1000000007
 
print(ans % 100000007)
# Judge status: Accepted
N, A = input(), [int(v) for v in input().split()]

# max(abs(x-y) for x, y in  zip(A, A[1:]))

stool = A[0]
ans = 0
for i, h in enumerate(A):
    if h < stool:
        ans += stool - h
    stool = max(stool, h)

print(ans)
# Judge status: Wrong Answer
N = int(input())
W = list(input())
a = 'Yes'

s = W[0]

for i in range(N-1):
    k = input()
    if s[-1]==k[0] and k not in W:
        W.append(k)
        s = W[-1]
    else:
        a = 'No'
        
        break

print(a)
# Judge status: Accepted
# AtCoder
N = int(input())
S = [input() for _ in range(N)]
print(len(set(S)))
# Judge status: Wrong Answer
A,B = map(int,input().split())
print(str(A * B))
# Judge status: Accepted
n,m = map(int,input().split())
s = []
for i in range(n):
    s.append(list(map(int,input().split())))
s.sort()
ans = 0
for i in s:
    if i[1]<m:
        ans += i[0]*i[1]
        m -= i[1]
    else:
        ans += i[0]*m
        break
print(ans)
# Judge status: Wrong Answer
x=input("alphabet:")
if x=="z":
    pass
if x!="z":
    print(chr(ord(x)+1))
# Judge status: Wrong Answer
def main():
    n = int(input())
    S = input()
    a, b = 0, 0
    m = float('inf')
    for s in S:
        if s == '(':
            a += 1
        else:
            b += 1
        m = min(m, a - b)
    print(''.join(['(' * (-m), S, ')' * (a - b - m)]))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a,b,x = map(int,input().split())
import math
if 2*x >= b*a**2:
    rad = math.atan(2*(b*a**2-x)*a**(-3))
    print(math.degrees(rad))
else:
    rad = math.atan(a*b**2/x)
    print(math.degrees(rad))
# Judge status: Wrong Answer
A,B,K=map(int,input().split())
if K>=A:
    K-=A
    A=0
    B=max(0,B-K)
print(A,B)
# Judge status: Accepted
n,k = map(int, input().split())
p = list(map(int, input().split()))

m = sum(p[:k])
index = 0
tmp = sum(p[:k])
for i in range(n-k):
    tmp -= p[i]
    tmp += p[i+k]
    if tmp > m:
        m = tmp
        index = i+1

def calc_exp(p):
    return ((p * (p+1)) / 2) / p
        
exp = 0
for i in range(index,index+k):
    exp += calc_exp(p[i])

print(exp)
# Judge status: Accepted
h, a = map(int, input().split())
print(int((h-0.1)//a + 1))
# Judge status: Wrong Answer
n = int(input())
s = input()
ans = 0
right = n-1
for i in range(n//2):
    if s[i] == "W":
        while right > i:
            if s[right] == "R":
                ans += 1
                right -= 1
                break
            else:
                right -= 1

print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
 
A = list(map(int, input().split()))
 
sum = 0
 
for i in range(n):
  sum += A[i]
  
counter = 0
rate = 4 * m
rate = sum / rate
for i in range(n):
  if A[i] >= rate:
    counter += 1
    
if counter >= m:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
a,b=map(int, input().split())
s=input()
l=len(s)
f=0
for i in s:
    if i=='-':
        f=f+1

if f==1:
    k=s.index('-')
    su=(k-0)
    f=(l-(k+1))
    if su==a and f==b and b==a+1:
        print("Yes")

else:
    print("No")
# Judge status: Wrong Answer
s = input()
k = int(input())

answer = 1
if len(s) == 1:
  answer = s
else :
  for i in range(len(s)):
    if s[i] != "1":
      answer = s[i]
      break
print(answer)
# Judge status: Accepted
import sys
from collections import Counter
readline = sys.stdin.buffer.readline
MOD = 10**9+7
INF = float('inf')

def main():
    N = int(readline())
    T, A = map(int, readline().split())
    H = list(map(int, readline().split()))
    small = INF
    for i in range(N):
        t = T - H[i]*0.006
        if abs(A-t)<small:
            ans = i + 1
            small = abs(A-t)
    print(ans)



if __name__ == '__main__':
    main()
# Judge status: Accepted
X, Y = map(int, input().split())
MOD = 10**9+7

def mod_pow(n, m):
  res = 1
  while m > 0:
    if m & 1:
      res = (res*n)%MOD
    n = (n*n)%MOD
    m >>= 1
  return res
  
if (2*Y-X)%3 != 0 or (2*X-Y)%3 != 0 or 2*Y < X or 2*X < Y:
  print(0)
else:
  A = (2*X-Y)//3
  B = (2*Y-X)//3
  m = 1
  n = 1
  for i in range(A):
    m = (m*(A+B-i))%MOD
    n = (n*(A-i))%MOD
  inverse_n = mod_pow(n, MOD-2)
  print((m*inverse_n)%MOD)
# Judge status: Accepted
k,s=map(int,input().split())
cnt=0
for z in range(0,min(k+1,s+1)):
  s_=s-z
  if s_<=k:
    cnt+=(s_+1)
  else:
    v=s_-k
    if v<=k:
      cnt+=(k-v+1)
print(cnt)
# Judge status: Wrong Answer
N,M=map(int,input().split())
ans=[0]*N
for i in range(M):
    s,c=map(int,input().split())
    ans[s-1]=c
if N!=1 and ans[0]==0:
    print(-1)
else:
    l=[str(a) for a in ans]
    print("".join(l))
# Judge status: Wrong Answer
import numpy as np
N,K = map(int,input().split())
A = np.array(list(map(int,input().split())))
A_low = np.prod(A[:K])
A_high = A_low
for i,j in enumerate(range(K,N)):
    A_high = (A_low//A[i])*A[j]
    if(A_high > A_low):
        print('Yes')
    else:
        print('No')
    A_low = A_high
# Judge status: Accepted
S = input()
candidates = ['dream', 'dreamer', 'erase', 'eraser']

while S:
    for candidate in candidates:
        if S.endswith(candidate):
            S = S[:-len(candidate)]
            break
    else:
        break

if S:
    print('NO')
else:
    print('YES')
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=sum(b)-sum(a)
co=0
for i in range(n):
    if a[i]==b[i]:
        continue
    elif a[i]>b[i]:
        co+=a[i]-b[i]
    else:
        co+=(b[i]-a[i]+1)//2
print('Yes' if c>=co else 'No')
# Judge status: Accepted
n = int(input())
la = [int(w) for w in input().split()]
la.sort(reverse=True)

ans = la[0]
cnt = n - 2
for a in la[1:]:
    if cnt >= 2:
        cnt -= 2
        ans += a * 2
    elif cnt == 1:
        cnt -= 1
        ans += a
    else:
        break
print(ans)
# Judge status: Wrong Answer
a = input()
b = input()
a1 = sorted(a)
b1 = sorted(b)
if(a1 == b1):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import sys

n, l = map(int, sys.stdin.readline().split())

def main():
    s = (l - 1) * n + (1 + n) * n // 2
    res = []
    for i in range(1, n+1):
        f = l + i - 1
        res.append((abs(f), s - f))
    
    res.sort()
    return res[0][1]

if __name__=='__main__':
    ans = main()
    print(ans)
# Judge status: Wrong Answer
# coding: utf-8
# Your code here!
import itertools


k, s = map(int, input().split())

lst = [i for i in range(k+1)]


prod = itertools.product(lst, repeat=3)



ans = 0


print(ans)
# Judge status: Wrong Answer
import math 
x=int(input())
y=int(math.sqrt(x))
print(y)
# Judge status: Accepted
n = int(input())
num = list(map(int,input().split()))

from fractions import gcd
l = [0]
r = [0]
for i in range(n-1):
  l += [gcd(l[i],num[i])]
  r += [gcd(r[i],num[-i-1])]
  
print(max(gcd(r[i],l[-i-1]) for i in range(n)))
# Judge status: Accepted
from collections import Counter
N = int(input())
A = [input() for _ in range(N)]

res = 0
#print(Counter(A))

c = Counter(A)
for i in c.values():
    res += i % 2
print(res)
# Judge status: Accepted
HM = list(map(int, input().split()))
hours = HM[2]-HM[0]
minutes = HM[3]-HM[1]
K = HM[4]
totalTimes = hours*60+minutes
print(totalTimes-K)
# Judge status: Accepted
n, q = list(map(int, input().split()))
s = input()

cnt = [0 for i in range(n)]
ac = 0
for i in range(1, n):
    if s[i-1:i+1] == "AC":
        ac += 1

    cnt[i] = ac

for i in range(q):
    l, r = list(map(int, input().split()))

    print(cnt[r-1]-cnt[l-1])
# Judge status: Accepted
A, B = map(int, input().split())

answer = 'IMPOSSIBLE'
start = (A + B) // 2 - 1
end = (A + B) // 2 + 1


for i in range(start, end+1):
    a = abs(A - i)
    b = abs(B - i)
    
    if a == b:
        answer = i
        break

print(answer)
# Judge status: Accepted
a, b = [int(i) for i in input().split()]
m = (a * 10 + b * 10) // 2
x = (m + 9) // 10
print(x)
# Judge status: Wrong Answer
s = raw_input()
if 'a' and 'b' and 'c' in s:
    print 'Yes'
elif 'a' or 'b' or 'c' not in s:
    print 'No'
# Judge status: Wrong Answer
n = int(input())

if n < 4:
    print("No")
elif n % 4 == 0:
    print("Yes")
elif n % 7 == 0:
    print("Yes")
elif n % 11 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import sys
read = sys.stdin.read

h,n,*lst=map(int, read().split())
s=sum(lst)
if s<=h:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
def hantei(s):
    for i in range(10):
        if n.count(str(i))>=3:
            return True

n=list(input())
if hantei(n):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N=int(input())
S=str(input())
ans=0
for i in range(1,N):
    X=set(S[:i])
    Y=set(S[i:])
    print(X)
    print(Y)
    X&=Y
    ans=max(ans,len(X))
print(ans)
# Judge status: Accepted
A,B = map(int,input().split())

Ha = (B-A-1)*(B-A)//2

for x in range(1,Ha):
  if Ha-x == A:
    print(x)
    exit()
# Judge status: Wrong Answer
N, M = map(int, input().split())

ans_list = []

for i in range(M):
    ans_list.append(input().split())

wa = 0
ac = 0
flag = 0

for n in range(1,N+1):

    for t in range(M):
        if ans_list[t][0] == str(n) and ans_list[t][1] == "AC":
            ac += 1
            break

        elif ans_list[t][0] == str(n) and ans_list[t][1] == "WA":
            wa += 1

print(ac, wa)
# Judge status: Accepted
q,h,s,d = map(int,input().split())
n = int(input())
s = min(s,min(q*2,h)*2)
if s*2<d:
    print(n*s)
else:
    if n%2==0:
        print((n//2)*d)
    else:
        print((n//2)*d+s)
# Judge status: Accepted
import copy
import heapq

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

tmp_list = list(map(lambda x: x * -1, a_list))

heapq.heapify(tmp_list)
#print(tmp_list)

for i in range(m):
    max_value = heapq.heappop(tmp_list)*-1
    #print(max_value)
    heapq.heappush(tmp_list, -1*(max_value//2))

print(str(int(-sum(tmp_list))))
# Judge status: Wrong Answer
a,b = map(int,input().split())
s = input()
print("Yes" if s[:a].isdigit() and s[a+1:].isdigit() else "No")
# Judge status: Accepted
a,b,c = map(int,input().split())
if a %2 == 1 or b %2 == 1 or c %2 == 1:
    print(0)
elif a == b and b == c and c == a:
    print(-1)
else:
    cnt = 0
    while(True):
        cnt += 1
        ta = b//2 + c //2
        tb = a//2 + c //2
        tc = a//2 + b //2
        if ta %2 == 1 or tb %2 == 1 or tc %2 == 1:
            break
        a,b,c = ta,tb,tc
    print(cnt)
# Judge status: Wrong Answer
# C - Many Requirements
N,M,Q = map(int,input().split())
q = []
for i in range(Q):
    q.append(list(map(int,input().split())))
q.sort()
dp = [[0]*(M+1) for _ in range(N+1)]
for a,b,c,d in q:
    for i in range(1,M-c+1):
        dp[b][i+c] = max(dp[b][i+c],dp[a][i]+d)
print(max(max(dp)))
# Judge status: Accepted
n=int(input())
c0,c1,c2,c3=0,0,0,0

for i in range (n):
    s=input()
    if(s=='AC'):
        c0=c0+1
    if (s=='WA'):
        c1+=1
    if(s=='TLE'):
        c2+=1
    if(s=='RE'):
        c3+=1
print("AC x ",c0)
print("\nWA x ",c1)
print("\nTLE x ",c2)
print("\nRE x ",c3)
# Judge status: Wrong Answer
N = input()
if len(set(list(N))) == 1:
  print(N)
else:
  if int(N) < int(str(int(N[0])+1)*3):
    print(N[0]*3)
  else:
  	print(str(int(N[0])+1)*3)
# Judge status: Wrong Answer
t=input()
N=int(t.split()[0])
M=int(t.split()[1])

city=[0]*M
for i in range(M):
  te=[int(x) for x in input().split()]
  city[i]={'i':i+1,'p':int(te[0]),'y':int(te[1])}

city_sorted = sorted(city,key = lambda x: (x['p'], x['y']))

x=0
temp_p=city_sorted[0]['p']
for c in city_sorted:
  if temp_p == c['p']:
    x+=1
  else:
    print("hoge")
    temp_p=c['p']
    x=1
  c['id']="{0:06d}{1:06d}".format(c['p'],x)
  
for ci in city:
  print(ci['id'])
# Judge status: Accepted
n, m, k = map(int, input().split())
if k % n == 0 or k % m == 0:
    print('Yes')
    exit()
for i in range(n):
    for j in range(m):
        if m*i + n*j - i*j*2 == k:
            print('Yes')
            exit()
print('No')
# Judge status: Wrong Answer
N = int(input())
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A2.reverse()

for i in range(N-1):
  A1[i+1] += A1[i]
  A2[i+1] += A2[i]
  
ans = 100000
for i in range(N):
  ans = max(ans, A1[i]+A2[N-1-i])
  
print(ans)
# Judge status: Accepted
x, y = map(int, input().split())

ans = 10000000000
if y >= x:
    ans = min(ans, y-x)
if y >= -x:
    ans = min(ans, y+x+1)
if -y >= x:
    ans = min(ans, 1-x-y)
if -y >= -x:
    ans = min(ans, x-y+2)
print(ans)
# Judge status: Accepted
a,b,c = map(int,input().split())
k = int(input())
for i in range(k):
    if a < b and b < c:
        print("Yes")
        exit()
    elif a >= b:
        b *= 2
    elif b >= c:
        c *= 2
if a < b and b < c:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())

s = ""
while abs(N) > 0:
    m = N % (-2)
    if m != 0:
        s = "1" + s
    else:
        s = "0" + s
    N = (N+m) // (-2)
    print(m, N)
print(s)
# Judge status: Accepted
N,M=map(int,input().split())
print(['Yes','No'][N!=M])
# Judge status: Wrong Answer
X = list(map(int, input().split()))

for i in range(len(X)):
  if X[i-1] == 0:
    print(i)
# Judge status: Accepted
s = input()
l = len(s)
n = int(input())
ans = ["A"]*l
for i in range(l-1):
  if s[i]=="a":
    ans[i]="a"
    continue
  temp = ord("z")-ord(s[i])+1
  if temp <= n:
    n-=temp
    ans[i]="a"
  else:
    ans[i]=s[i]

last = ord(s[l-1])+n
#print(last)
while last>ord("z"):
  last-=26
ans[l-1]=chr(last)
print("".join(ans))
# Judge status: Wrong Answer
N,K =map(int,input().split())
A=list(map(int,input().split()))

def light_change(A):
    B=[0 for _ in range(len(A))]
    for i in range(len(A)):
        for j in range(max(0,i-A[i]),min(len(A),i+A[i]+1)):
            B[j]+=1
    return B
  
for _ in range(K):
  A=light_change(A)
print(A)
# Judge status: Wrong Answer
A, B, C, D = map(int, input().split())

n = int(A/D)
m = int(C/B)
i = 1
a = C
t = A


if n>m:
    x = n
else :
    x = m
    
for i in range(1, x+1):
    a = a - B
    t = t - D
    if a <= 0:
        break 
    elif t <= 0:
        break
    
    
if a <= 0:
    print('Yes')
elif t <= 0:
    print('No')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

real = 1000
unreal = 0

for i in range(n-1):

    if a[i] < a[i+1]:
        get_unreal, real = divmod(real, a[i])
        unreal += get_unreal

    elif a[i] > a[i+1]:
        real += (unreal * a[i])
        unreal = 0

    else:
        continue

real += unreal * a[n-1]
print(real)
# Judge status: Accepted
a, b, c = map(int, input().split())

if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
    print(0)
elif a == b == c:
    print(-1)
else:
    count = 0
    while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        a, b, c = (b+c)/2, (a+c)/2, (a+b)/2
        count += 1
    print(count)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

S = list(input())
from collections import Counter
c = Counter(S)
if abs(c['a']-c['b'])<=1 and abs(c['a']-c['c'])<=1 and abs(c['b']-c['c'])<=1:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
import sys
input = sys.stdin.readline
N = int(input())
res = 0
for i in range(1, N + 1): res += (N - 1) // i
print(res)
# Judge status: Wrong Answer
w,a,b=map(int,input().split())
if a >= b:
        print(a-b)
elif a+w>=b:
    print('0')
else:
    print(b-a-w)
# Judge status: Wrong Answer
#!/usr/bin/env python3

x = int(input())

if 400 <= x <= 599:
    print(8)
elif 600 <= x < 799:
    print(7)
elif 800 <= x <= 999:
    print(6)
elif 1000 <= x <= 1199:
    print(5)
elif 1200 <= x <= 1399:
    print(4)
elif 1400 <= x <= 1599:
    print(3)
elif 1600 <= x <= 1799:
    print(2)
else:
    print(1)
# Judge status: Wrong Answer
#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter, deque
#from scipy.misc import comb

MOD = 10**9+7
N,M = map(int, input().split())

if N < M: N,M = M,N

ans = 1
if N-M == 0:
    for i in range(1,M+1):
        ans *= i
        ans % MOD
    ans = (ans*ans*2)%MOD
elif N-M == 1:
    for i in range(1,M+1):
        ans *= i
        ans %= MOD
    ans = (ans*ans)%MOD
else: ans = 0

print(ans)
# Judge status: Wrong Answer
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
ans="No"
if v<=w:
    ans="No"
else:
    if a>b:
        (a-b)//(v-w)+1<=t
        ans="Yes"
    else:
        (b-a)//(v-w)+1<=t
        ans="Yes"
# Judge status: Accepted
N, K = map(int, input().split())
S = input()

def solve(S):
    ans = 0
    switch = 0
    for i in range(1,N):
        if S[i]!=S[i-1]:
            switch += 1
    switch = max(0,switch-K*2)
    ans = N-switch-1
    return ans
print(solve(S))
# Judge status: Accepted
import sys
N, K = map(int, sys.stdin.readline().split())
cnt = 0
while K <= N+1:
  cnt += (2*N-K+1)*K//2 - (K-1)*K//2 + 1
  K += 1
print(cnt%(10**9+7))
# Judge status: Accepted
def calc_max_fomula_by_list(numbers: list) -> int:
    sorted_numbers = numbers
    sorted_numbers.sort(reverse=True)
    return sorted_numbers[0] * 10 + sorted_numbers[1] + sorted_numbers[2]
    

def main():
    inputs = list( map(lambda x:int(x), input().split(' ')) )
    print(calc_max_fomula_by_list(inputs))


if __name__ == '__main__':
    main()
# Judge status: Accepted
import math
N = int(input())

C = [list(map(int,input().split())) for i in range(N-1)]

for i in range(N-1):
    total = 0
    for j in range(i,N-1):
        total = max(math.ceil(total/C[j][2])*C[j][2],C[j][1])
        total += C[j][0]
    print(total)

print(0)
# Judge status: Accepted
if __name__ == "__main__":
    n, a, b = map(int, input().split())

    if n == 1 and a == b:
        print(1)
        exit()
    elif n == 1:
        print(0)
        exit()
    elif a > b:
        print(0)
        exit()
    elif n == 2:
        print(1)
        exit()

    n_min = b + (n-1)*a
    n_max = a + (n-1)*b

    print(n_max-n_min+1)
# Judge status: Accepted
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def main():
    X = int(input())
    print(X ^ 1)


if __name__ == "__main__":
    main()
# Judge status: Accepted
s = input()
if len(s) % 2 == 1:
  print("No")
  exit()

for i in range(0, len(s), 2):
  if s[i:i+2] != "hi":
    print("No")
    exit()
print("Yes")
# Judge status: Accepted
W, H, x, y = map(int, input().split())
flag = 0
if W % 2 == 0 and H % 2 == 0:
    if x == W // 2 and y == H // 2:
        flag = 1
print(W * H / 2, flag)
# Judge status: Wrong Answer
a, b, c, d = list(map(int, input().split()))
if c - a <= d:
    print("Yes")
elif b - a <= d and c - b <= d:
    print("Yes")
else:
    print("No")
# Judge status: Accepted

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

mini = (L * R) % 2019

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

for i in range(L % 2019, R % 2019):
    for j in range(i + 1, R % 2019 + 1):
        mini = min(mini, (i * j) % 2019)



print(mini)
# Judge status: Accepted
N = int(input())
num = 1
c = 0
t = 0
for i in range(N,-1,-1):
    j = i
    c = 0
    while 1 < j:
        if j % 2 == 0:
            c += 1
        j //= 2
    if t < c:
        t = c
        num = i
print(num)
# Judge status: Accepted
def check():
  S = input()
  T = input()
  S *= 2
  for i in range(len(T)):
    if S[i:i+len(T)]==T:
      return 'Yes'
  return 'No'
print(check())
# Judge status: Wrong Answer
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

at = v*t + a
bt = w*t + b

if a < b:
    if at >= bt:
        print('YES')
    else:
        print('NO')
elif a > b:
    if bt >= at:
        print('YES')
    else:
        print('NO')
# Judge status: Wrong Answer
a=int(input())
print(bin(-(a-2))[2:])
# Judge status: Accepted
from fractions import gcd
import sys
input = sys.stdin.readline

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

cnt = 1
for i in range(n):
    cnt = a[i] * cnt // gcd(a[i], cnt)

b = [cnt // a[i] for i in range(n)]
print(sum(b) % (10**9+7))
# Judge status: Accepted
s=sorted(list(input()))
t=sorted(list(input()),reverse=True)
for i in range(min(len(s),len(t))):
    if ord(s[i])<ord(t[i]):
        print("Yes")
        exit()
    elif ord(s[i])>ord(t[i]):
        print("No")
        exit()
if len(s)>=len(t):
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
W, H, N = map(int, input().split())
xy = [0, W, 0, H]
for n in range(N):
    x, y, a = map(int, input().split())
    a -= 1
    if a<=1:
        xy[a] = x
    else:
        xy[a] = y
    
area = (xy[1] - xy[0]) * (xy[3] - xy[2])
if area < 0:
    area = 0
print(area)
# Judge status: Accepted
s = input()
t = input()

ans = 'No'
for i in range(len(t)):
  if s == t[i:]+t[:i]:
    ans = 'Yes'
    break
print(ans)
# Judge status: Accepted
A, B, N = map(int, input().split())

ans = (A * min(N, B - 1)) // B - A * (min(N, B - 1) // B)
print(ans)
# Judge status: Wrong Answer
import math
a,b,n = map(int,input().split())
if n % b == 0:
    n = n -1
    print(math.floor((a * n)/b) - (a * math.floor(n/b)))
else:
    mm = max(0,(b * (n//b)) - 1)
    print(int(max(math.floor((a * n)/b) - (a * math.floor(n/b)),math.floor((a * mm)/b) - (a * math.floor(mm/b)))))
# Judge status: Accepted
a, b, c = map(int, input().split())
if a==5 or 7 and b==5 or 7 and c==5 or 7:
    if a+b+c == 17:
        print("YES")
    else:
        print("NO")
else:
    print("NO")
# Judge status: Accepted
Flag = False
A = []
for i in range(3):
  A.extend(list(map(int, input().split())))

N = int(input())
B = [int(input()) for i in range(N)]

for i in B:
  if i in A:
    A[A.index(i)] = 0

for i in range(3):
  if A[i] + A[i+3] + A[i+6] == 0:
    Flag = True
  if A[3*i] + A[3*i+1] + A[3*i+2] == 0:
    Flag = True

if A[0] + A[4] + A[8] == 0 or A[2] + A[4] + A[6] == 0:
  Flag = True

if Flag:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for i in range(n)]
cd = [list(map(int,input().split())) for i in range(m)]
min = 2e+8
c = 0

for i in range(n):
    for j in range(m):
        d = abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])
        if d<min:
            min=d
            c = j+1
    min = 2e+8
    print(c)
# Judge status: Accepted
n = int(input())
la = list(map(int, input().split()))
l1 = []
l2 = []
for i in range(n):
    if i % 2 == 0:
        l1.append(la[i])
    else:
        l2.append(la[i])

if n % 2 == 0:
    for i in reversed(l2):
        print(i, end=' ')
    for i in l1:
        print(i, end=' ')
else:
    for i in reversed(l1):
        print(i, end=' ')
    for i in l2:
        print(i, end=' ')
# Judge status: Accepted
a, b , c = map(int, input().split())
print(max(c - a + b, 0))
# Judge status: Accepted
x, y = map(int, input().split())
print(len(bin((y // x)))-2)
# Judge status: Accepted
s = input()
print("ABC" if s == "ARC" else "ARC")