Harryxun/stf_run huggingface dataset:
pupils = []

while True:
    l = list(map(int, input().split()))
    if sum(l) == -3:
        break
    pupils.append(l)

for pupil in pupils:
    score = pupil[0] + pupil[1]
    if pupil[0] == -1 or  pupil[1] == -1:
        rank = 'F'
    elif score >= 80:
        rank = 'A'
    elif score >= 65:
        rank = 'B'
    elif (score >= 50) or (score >= 30 and pupil[2] >= 50):
        rank = 'C'
    elif score >= 30:
        rank = 'D'
    else:
        rank = 'F'
    print(rank)

### FIXED CODE ###

n,m = list(map(int, input().split()))
a = []
b = []
result = []
row_sum = 0

for i in range(n):
    l = list(map(int, input().split()))
    a.append(l)

for i in range(m):
    b.append(int(input()))

for row in a:
    for i,num in enumerate(row):
        row_sum += num * b[i]
    print(row_sum)
    row_sum = 0
n = int(input())
a = [list(map(int, input().split())) for i in range(0, n)] 
at = list(map(list, zip(*a)))

if a != at: 
    print(-1)
    exit(0)

for u in range(0, n): 
    for v in range(u + 1, n): 
        for i in range(0, n): 
            if a[u][v] > a[u][i] + a[i][v]:
                print(-1)
                exit(0)

dr = list()
for u in range(0, n): 
    for v in range(u + 1, n): 
        if a[u][v] < min([a[u][i] + a[i][v] for i in [x for x in range(0, n) if x != u and x != v]]):
            dr.append(a[u][v])

print(sum(dr))

### FIXED CODE ###

import numpy as np

n = int(input())
a = np.array([np.array(input().split(), dtype=np.uint64) for _ in range(n)], dtype=np.uint64)

for i in range(n):
  a[i,i] = 1e9 + 1

ans = 0
for u in range(n):
    for v in range(u + 1, n): 
        dist = a[u,v]
        cd = np.min(a[u] + a[v])
        if dist > cd:
            print(-1)
            exit(0)
        if dist < cd:
            ans += dist
 
print(int(ans))
import math
n = int(input())
a = list(map(int,input().split()))
mx = max(a)
b=[0] * mx
ans = 0
for i in range(n):
    b[a[i]-1] += 1

for i in range(mx):
    if(b[i] == 0 or b[i] == 1):
        ans += 0
    else:
        ans = ans + math.factorial(b[i])/2 / math.factorial(b[i]-2)
ans1 = 0


for i in range(n):
    ans1 = ans
    if(b[a[i]-1] >2):
        ans1 = ans1 -(math.factorial(b[a[i]-1])/2 / math.factorial(b[a[i]-1]-2)) + (math.factorial(b[a[i]-1]-1)/2 / math.factorial(b[a[i]-1]-3))
        print(int(ans1))
    elif(b[a[i]-1] == 2):
        print(int(ans1-1))
    elif(b[a[i]-1] < 2):
        print(int(ans1))

### FIXED CODE ###

import math
n = int(input())
a = list(map(int,input().split()))
mx = max(a)
b=[0] * 2000000
ans = 0
for i in range(len(a)):
    b[a[i]-1] += 1

for i in range(mx):
    if(b[i] == 0 or b[i] == 1):
        ans += 0
    else:
        ans = ans + int(b[i] * (b[i]-1)/2)
ans1 = 0


for i in range(len(a)):
    ans1 = ans
    if(b[a[i]-1] >2):
        ans1 = ans1 -int((b[a[i]-1]*(b[a[i]-1]-1))/2) + int(((b[a[i]-1]-1) * (b[a[i]-1]-2))/2)
        print(int(ans1))
    elif(b[a[i]-1] == 2):
        print(int(ans1-1))
    elif(b[a[i]-1] < 2):
        print(int(ans1))
age,cost =list(map(int, input().split()))
if age<=5:
  print('0')
elif age>=6 and age<=12:
  print(a//2)
elif age>=13:
  print(a)


### FIXED CODE ###

n,k=tuple(map(int,input().split()))
if n >= 13:
  print(k)
elif 6 <= n <= 12:
  print(k//2)
elif n <= 5:
  print(0)
n=int(input())
a=[list(input()) for i in range(n)]
if max([a[i].count("#") for i in range(n)]) ==0:
  print(-1)
  exit()
minus=0
for i in range(n):
  if a[i].count(".")==0:
    minus=n
    break
  if a[i][i]=="#":
    minus=max(minus,a[i].count("#"))
b=zip(*a)
for j in range(n):
  if b[j].count(".")==0:
    minus+=1
print(2*n-minus)

### FIXED CODE ###

n=int(input())
a=[list(input()) for i in range(n)]
if max([a[i].count("#") for i in range(n)]) ==0:
  print(-1)
  exit()
minus=0
b=list(zip(*a))
for i in range(n):
  if b[i].count("#")>=1:
    minus=max(minus,a[i].count("#"))
  else:
    minus=max(minus,a[i].count("#")-1)
for j in range(n):
  if b[j].count(".")==0:
    minus+=1
print(2*n-minus)
#! -*- coding: utf-8-unix -*-
import sys

if __name__=='__main__':
  # lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
  # n = int(lines[0])
  n = input()
  for i in xrange(n):
    # x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, sys.stdin.readline().strip().split(' '))
    if x1 == x2:
      if x3 == x4:
        print 'YES'
      else:
        print 'NO'
    if y1 == y2:
      if y3 == y4:
        print 'YES'
      else:
        print 'NO'
    a1 = (y2 - y1) / (x2 - x1)
    b1 = y1 - a1 * x1
    a2 = (y4 - y3) / (x4 - x3)
    b2 = y3 - a2 * x3
    if (a1 == a2) and (b1 != b2):
      print 'YES'
    else:
      print 'NO'

### FIXED CODE ###

#! -*- coding: utf-8-unix -*-
import math

if __name__=='__main__':
  # lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
  # n = int(lines[0])
  n = int(raw_input())
  for i in xrange(n):
    # x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().strip().split(' '))
    # if x1 == x2 or x3 == x4:
    #   if x1 == x2 and x3 == x4:
    #     print 'YES'
    #   else:
    #     print 'NO'
    #   continue
    # elif y1 == y2 or y3 == y4:
    #   if y1 == y2 and y3 == y4:
    #     print 'YES'
    #   else:
    #     print 'NO'
    #   continue
    # else:
      # if (y2 - y1) * (x4 - x3) == (y4 - y3) * (x2 - x1):
    if math.fabs((y2 - y1) * (x4 - x3) - (y4 - y3) * (x2 - x1)) < 1e-10:
      print 'YES'
    else:
      print 'NO'
      # a1 = (y2 - y1) / (x2 - x1)
      # b1 = y1 - a1 * x1
      # a2 = (y4 - y3) / (x4 - x3)
      # b2 = y3 - a2 * x3
      # if (a1 == a2):# and (b1 != b2):
      #   print 'YES'
      # else:
      #   print 'NO'
    # except:
    #   break
s = input()
N = len(s)
s_trim = ''.join([c for c in s if c != 'x'])
N_trim = len(s_trim)

def check_anagram():
    for i in range(N_trim):
        j = N_trim - 1 - i
        if s_trim[i] != s_trim[j]:
            return False
    return True

def solve():
    if not check_anagram():
        return -1

    # Center of anagram
    pr = N_trim // 2
    pl = pr
    if N_trim % 2 == 0:
        pl -= 1

    xl = 0
    tl = 0
    while xl < N:
        if s[xl] != 'x':
            assert s[xl] == s_trim[tl]
            if tl == pl:
                break
            tl += 1
        xl += 1

    if N_trim % 2 == 1:
        xr = xl
    else:
        xr = xl + 1
        while s[xr] == 'x':
            xr += 1

    cost = 0
    while True:
        assert s[xl] == s_trim[pl]
        #assert s[xr] == s_trim[pr]
        if s[xr] != s_trim[pr]:
            while True: pass
        assert s[xl] == s[xr]
        assert s_trim[pl] == s_trim[pr]
        pl -= 1; pr += 1
        while True:
            xl -= 1; xr += 1
            if not (xl >= 0 and xr < N and s[xl] == 'x' and s[xr] == 'x'):
                break
        while xl >= 0 and s[xl] == 'x':
            cost += 1
            xl -= 1
        while xr < N and s[xr] == 'x':
            cost += 1
            xr += 1
        if pl < 0 and pr >= N_trim and xl < 0 and xr >= N:
            return cost

print(solve())


### FIXED CODE ###

s = input()
N = len(s)
s_trim = ''.join([c for c in s if c != 'x'])
N_trim = len(s_trim)

def check_anagram():
    for i in range(N_trim):
        j = N_trim - 1 - i
        if s_trim[i] != s_trim[j]:
            return False
    return True

def solve():
    if not check_anagram():
        return -1
    if N_trim == 0:
        return 0
    # Center of anagram
    pr = N_trim // 2
    pl = pr
    if N_trim % 2 == 0:
        pl -= 1

    xl = 0
    tl = 0
    while xl < N:
        if s[xl] != 'x':
            # assert s[xl] == s_trim[tl]
            if tl == pl:
                break
            tl += 1
        xl += 1

    if N_trim % 2 == 1:
        xr = xl
    else:
        xr = xl + 1
        while s[xr] == 'x':
            xr += 1

    cost = 0
    while True:
        # assert s[xl] == s_trim[pl]
        # assert s[xr] == s_trim[pr]
        # assert s[xl] == s[xr]
        # assert s_trim[pl] == s_trim[pr]
        pl -= 1; pr += 1
        while True:
            xl -= 1; xr += 1
            if not (xl >= 0 and xr < N and s[xl] == 'x' and s[xr] == 'x'):
                break
        while xl >= 0 and s[xl] == 'x':
            cost += 1
            xl -= 1
        while xr < N and s[xr] == 'x':
            cost += 1
            xr += 1
        if pl < 0 and pr >= N_trim and xl < 0 and xr >= N:
            return cost

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

ans = (b - c) < 0 ? 0 : b - c

print(ans)

### FIXED CODE ###

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

start = a if a > c else c
end = b if b < d else d

ans = 0 if b < c or d < a else end - start



print(ans)
N = input()

print('Yes' if sum(map(int,N)) % N == 0 else 'No')

### FIXED CODE ###

N = input()
print("No" if int(N) % sum(map(int, N)) else "Yes")
N = int(input())
a = map(int, input().split(' '))

ok = True

for i in range(N):
  if a[i] >= sum(a) - a[i]:
    ok = False

print("Yes" if ok else "No")

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split(' ')))
 
ok = True
 
for i in range(N):
  if a[i] >= sum(a) - a[i]:
    ok = False
 
print("Yes" if ok else "No")
N, M = map(int, input().split())
Costs = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
A = sorted(list(map(int, input().split())), reverse=True)  # 大きい順に


# dp[i]:= マッチ棒をn本使って得られる最大桁数(-infはマッチ棒が使いきれないことを表す)
dp = [-float('inf')] * (N + 1)
dp[0] = 0

# 蟻本P.60みたいなことをします
for i in range(M):
    cost = Costs[A[i]]
    for j in range(N + 1):
        if cost > j:
            continue
        dp[j] = max(dp[j], dp[j - cost] + 1)


# dpの復元
ans = ""
marker = N  # いま何本残っているか
while dp[marker]:  # 0本になるまで回す
    for a in A:  # 大きな数字から見ていく
        cost = Costs[a]
        # marker本ある状態から、マッチ棒をcost本使う数字aを使わなければ、marker本使った場合の桁数-1になる場合、
        # 数字aを使ったことがわかる
        if dp[marker - cost] == dp[marker] - 1:
            ans += str(a)
            marker = marker - cost
            break

print(ans)


### FIXED CODE ###

N, M = map(int, input().split())
Costs = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
A = sorted(list(map(int, input().split())), reverse=True)  # 大きい順に


# dp[i]:= マッチ棒をn本使って得られる最大桁数(-infはマッチ棒が使いきれないことを表す)
dp = [-float('inf')] * (N + 1)
dp[0] = 0

# 個数制限なしナップサックと同じ要領
for a in A:
    cost = Costs[a]
    for j in range(N + 1):
        if cost > j:
            continue
        dp[j] = max(dp[j], dp[j - cost] + 1)


# dpの復元
ans = ""
marker = N  # いま何本残っているか
while dp[marker]:  # 0本になるまで回す
    for a in A:  # 大きな数字から見ていく
        cost = Costs[a]
        
        # Python特有のバグ消し
        if marker - cost < 0:
            continue
        
        # marker本ある状態から、マッチ棒をcost本使う数字aを使わなければ、marker本使った場合の桁数-1になる場合、
        # 数字aを使ったことがわかる
        if dp[marker - cost] == dp[marker] - 1:
            ans += str(a)
            marker = marker - cost
            break

print(ans)
n = int(input())
a_s = map(int, input().split(' '))
b_s = map(int, input().split(' '))
c_s = map(int, input().split(' '))

i = 0
a = a_s[i]
b = b_s[a]

before_a = a
sas = b
for i in range(1, n):
  a = a_s[i]
  b = b_s[a]
  sas += b
  if before_a + 1 = a:
    sas += c_s[i-1]
  before_a = a

### FIXED CODE ###

n = int(input())
a_s = list(map(int, input().split(' ')))
b_s = list(map(int, input().split(' ')))
c_s = list(map(int, input().split(' ')))

sat = 0
for a_i in range(0, n):
    i = a_s[a_i] - 1
    b = b_s[i]
    sat += b
    if a_i < n-1 and a_s[a_i] +1 == a_s[a_i+1]:
        if i >= 0:
            sat += c_s[i]
print(sat)
data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]

# ??\?????????????????????????????§????????????????????????????????????
coutnt = int(input(1))
for c in range(count):
    c, f, r, v = [int(1) for i in input().split]
    data[b - 1][f - 1][r - 1] += v
    

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
    
        print()

    if bi < 3:
        print('#' * 20)

### FIXED CODE ###

data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]
    
count = int(input())
for c in range(count):
    b,f,r,v = [int(i) for i in input().split()]
    data[b-1] [f-1] [r-1] += v
    
for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
        print()
    if bi < 3:
        print('#' * 20)
from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
import math

def get_circle_center_and_radius(x1, y1, x2, y2, x3, y3):
    """
    3点を通る円の中心と半径を取得
    """
    d = 2 * ((y1 - y3) * (x1 - x2) - (y1 - y2) * (x1 - x3))
    if d==0:
        return(0)
    x = ((y1 - y3) * (y1 ** 2 - y2 ** 2 + x1 ** 2 - x2 ** 2) - (y1 - y2) * (y1 ** 2 - y3 ** 2 + x1 ** 2 - x3 ** 2)) / d
    y = ((x1 - x3) * (x1 ** 2 - x2 ** 2 + y1 ** 2 - y2 ** 2) - (x1 - x2) * (x1 ** 2 - x3 ** 2 + y1 ** 2 - y3 ** 2)) / -d
    #r = math.sqrt((x - x1) ** 2 + (y - y1) ** 2)
    return (x, y)
#N=int(input())
#X,Y=map(int,input().split())
#S=list(map(int,input().split()))
#S=[list(map(int,input().split())) for i in range(N)]
N,K=map(int,input().split())
XYC=[list(map(int,input().split())) for i in range(N)]
if K==1:
    print(0)
    exit()
count=10**18

if N>=2:
    nlst=combinations(list(range(N)),2)

    for n1,n2 in nlst:
        x1,y1,c1=XYC[n1]
        x2,y2,c2=XYC[n2]
        A=c1+c2
        X=(x1*c1+x2*c2)/A
        Y=(y1*c1+y2*c2)/A
        count1=[]
        for x,y,c in XYC:
            count1.append(((X-x)**2+(Y-y)**2)**0.5*c)
        count1.sort()
        #print(X,Y,count1)
        count=min(count,count1[K-1])

if N>=3:
    nlst=combinations(list(range(N)),3)
    for n1,n2,n3 in nlst:
        x1,y1,c1=XYC[n1]
        x2,y2,c2=XYC[n2]
        x3,y3,c3=XYC[n3]
        C=get_circle_center_and_radius(c1*x1,c1*y1,c2*x2,c2*y2,c3*x3,c3*y3)
        if C:
            X,Y=C
        else:
            continue
        X,Y=X/A,Y/A

        count1=[]
        for x,y,c in XYC:
            count1.append(((X-x)**2+(Y-y)**2)**0.5*c)
        count1.sort()

        count=min(count,count1[K-1])

print(count)


### FIXED CODE ###

from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
#import math

#N=int(input())
#X,Y=map(int,input().split())
#S=list(map(int,input().split()))
#S=[list(map(int,input().split())) for i in range(N)]

N=int(input())
print(N//2+N%2)
rate = 380000
N = int(input())

total = 0
for i in range(N):
    x,u = input()
    val = int(x)
    if u=='BTC':
        val *= rate
    total += val
print(total)


### FIXED CODE ###

rate = 380000
N = int(input())

total = 0
for i in range(N):
    x, u = input().split()
    val = float(x)
    if u=='BTC':
        val *= rate
    total += val
print(total)
ans=0
for i in range(1,n+1):
  if len(str(i))%2:
    ans+=1
print(ans)

### FIXED CODE ###

ans=0
for i in range(1,int(input())+1):
  if len(str(i))%2:
    ans+=1
print(ans)
pn =0
qn =0
count =0
for x in itertools.permutations(range(1,N+1,1)):
    count+=1
    tmp = " ".join(list(map(str,x)))
    if tmp == P:
        pn = count
    if tmp == Q:
        qn = count
print(abs(qn-pn))

### FIXED CODE ###

import itertools

N = int(input())
P = input()
Q = input()
pn =0
qn =0
count =0
for x in itertools.permutations(range(1,N+1,1)):
    count+=1
    tmp = " ".join(list(map(str,x)))
    if tmp == P:
        pn = count
    if tmp == Q:
        qn = count
print(abs(qn-pn))
from math import gcd
n = int(input())
a = list(map(int,input().split()))
left = []
right = []

left.append(a[0])
for i in range(1,n-1):
    left.append(gcd(left[-1],a[i]))
a = a[::-1]
right.append(a[0])
for i in range(1,n-1):
    right.append(gcd(right[-1],a[i]))
ans = 1
for i in range(n-1):
    ans = max(ans,gcd(left[i],right[n-i-3]))
ans = max(ans,left[n-2],right[n-2])
print(ans)


### FIXED CODE ###

from fractions import gcd
n = int(input())
a = list(map(int,input().split()))
GCD= a[0]
dp = [set() for i in range(n)]
dp[1].add(a[0])
dp[1].add(a[1])
for i in range(1,n):
    x = a[i]
    for j in dp[i-1]:
            dp[i].add(gcd(j,x))
    if x % GCD != 0:
        dp[i].add(GCD)
        GCD = gcd(GCD,x)
print(max(dp[n-1]))
N, M = map(int, input().split())
H = list(map(int, input().split()))
root = [list(map(int, input().split())) for _ in range(M)]

is_min = [0 for _ in range(N)]
for i in range(M):
    A = root[i][0] - 1
    B = root[i][1] - 1

    if H[A] > H[B]]:
        is_min[B] = 1

    elif H[A] == H[B]]:
        is_min[A] = 1
        is_min[B] = 1

    else:
        is_min[A] = 1

print(N - sum(is_min))


### FIXED CODE ###

N, M = map(int, input().split())
H = list(map(int, input().split()))
Q = [list(map(int, input().split())) for _ in range(M)]

tmp = [0 for _ in range(N)]
for i in range(M):
  if H[Q[i][0]-1] >= H[Q[i][1]-1]:
    tmp[Q[i][1]-1] = -1
  if H[Q[i][0]-1]<= H[Q[i][1]-1]:
    tmp[Q[i][0]-1] = -1

print(N + sum(tmp))
x, y = map(int, input().split())

def func(x,y):
    if y % 2 == 1:
        return False
    if 4*x < y:
        return False
    else:
        return True
    
if func(x,y):
    print("Yes")
else:

### FIXED CODE ###

x, y = map(int, input().split())

def func(x,y):
    if y % 2 == 1:
        return False
    if 4*x < y:
        return False
    if y < 2*x:
        return False
    else:
        return True
    
if func(x,y):
    print("Yes")
else:
    print("No")
import sys
from itertools import accumulate

def main():
    
    # sys.stdin = open('input154d.txt')

    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    
    s = [0] + p
    s = list(accumulate(s))

    maxp = 0
    index = 0
    for i in range(k, n):
      nowp = s[i] - s[i - k]
      if maxp < nowp:
        maxp = nowp
        index = i

    sump = 0
    for j in range(i-k, i):
      sump += p[j] * (p[j] + 1) / 2 / p[j]

    print(sump)
        
if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from itertools import accumulate

def main():
    
    # sys.stdin = open('input154d.txt')

    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    
    s = [0] + p
    s = list(accumulate(s))

    # print(p)
    # print(s)
    maxp = 0
    idx = 0
    for i in range(n - k + 1):
      nowp = s[i + k] - s[i]
      # print(i)
      # print(nowp)
      if maxp < nowp:
        maxp = nowp
        idx = i

    # print(idx)

    sump = 0
    for j in range(idx, idx+k):
      sump += p[j] * (p[j] + 1) / 2 / p[j]

    print(sump)
        
if __name__ == '__main__':
    main()
import sys
N,M = map(int, input(). split())
s = [0,]*M
c = [0,]*M
ans =[10,]*N
for i in range(M):
    s[i], c[i] = map(int, input(). split())
    if ans[s[i]-1] != 10 and ans[s[i]-1] != c[i]:
        print(-1)
        sys.exit()
    else:
        ans[s[i]-1] = c[i]
if ans[0] == 0:
    print(-1)
    sys.exit()
elif ans[0] == 10:
    ans[0] = 1
    A = 0
    for j in range(N):
        if ans[j] == 10:
            ans[j] = 0
    for k in range(N):
        A += 10**(M-k)*ans[k] 
    print(A)
        
else:
    A = 0
    for j in range(N):
        if ans[j] == 10:
            ans[j] = 0
    for k in range(N):
        A += 10**(M-k)*ans[k] 
    print(A

### FIXED CODE ###

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

s = [0,]*M
c = [0,]*M
ans =[10,]*N



for i in range(M):
    s[i], c[i] = map(int, input(). split())
    if ans[s[i]-1] != 10 and ans[s[i]-1] != c[i]:
        print(-1)
        sys.exit()
    else:
        ans[s[i]-1] = c[i]       
if N >= 2:
        
    A = 0        
    if ans[0] == 0:
        print(-1)
        sys.exit()
    elif ans[0] == 10:
        ans[0] = 1
        for j in range(N):
            if ans[j] == 10:
                ans[j] = 0
        for k in range(N):
            A += 10**(N-k-1)*ans[k] 
    
        print(A)
        
    else:
        for j in range(N):
            if ans[j] == 10:
                ans[j] = 0
        for k in range(N):
            A += 10**(N-k-1)*ans[k] 
        print(A)
else:
    A = 0
    if ans[0] == 0 or ans[0] == 10:
        print(0)
    else:
        print(ans[0])
X = list(map(int, input().split()))
X.sort()
print(0.5*(X[0]*X[1])

### FIXED CODE ###

X = list(map(int, input().split()))
X.sort()
print(int(0.5*X[0]*X[1]))
s = str(input())

w = ['Sunny','Cloudy','Rainy']

print(w[w.index(s)+1])

### FIXED CODE ###

s = str(input())

w = ['Sunny','Cloudy','Rainy']

print(w[( w.index(s)+1) %3] )
N = int(input())
s = input()

dp = [[0 for _ in range(N+1)] for _ in range(N+1)]

for i in range(N-1, 0, -1):
  for j in range(N-1, 0, -1):
    if s[i] != s[j]:
      dp[i][j] = 0
    else:
      dp[i][j] = dp[i+1][j+1] + 1
    
ans = 0
for i in range(N):
  for j in range(N):
    if i >= j:
      continue
    now = min(dp[i][j], j - i)
    ans = max(ans, now)
print(ans)


### FIXED CODE ###

N = int(input())
s = input()

dp = [[0 for _ in range(N+1)] for _ in range(N+1)]

for i in range(N-1, -1, -1):
  for j in range(N-1, -1, -1):
    if s[i] != s[j]:
      dp[i][j] = 0
    else:
      dp[i][j] = dp[i+1][j+1] + 1
    
ans = 0
for i in range(N):
  for j in range(N):
    if i >= j:
      continue
    now = min(dp[i][j], j - i)
    ans = max(ans, now)
print(ans)
N = int(input())
p = [int(p_i) for p_i in input().split()]

answer = 0
for i in range(N):
	if p[i] == i+1:
		answer += 1
		p[i+1] = p[i]

print(answer)

### FIXED CODE ###

N = int(input())
p = [int(p_i) for p_i in input().split()]
p.append(0)
answer = 0
for i in range(N):
	if p[i] == i+1:
		answer += 1
		p[i+1] = p[i]

print(answer)
n, u, v = map(int, input().split())
# よりたかはしくんが早く辿り着ける葉のうち、青木君から最も遠いで
u -= 1
v -= 1

g = [[] for _ in range(n)]
for _ in range(n - 1):
    a, b = map(lambda x: int(x) - 1, input().split())
    g[a].append(b)
    g[b].append(a)

INF = 1 << 30
t = [INF] * n
a = [INF] * n

t[u] = 0
a[v] = 0


def dfs(v, p, d):
    for nv in g[v]:
        if nv == p:
            continue
        if d[nv] == INF:
            d[nv] = d[v] + 1
            dfs(nv, v, d)


dfs(u, -1, t)
dfs(v, -1, a)

ans = 0
for i in range(n):
    if t[i] < a[i]:
        ans = max(ans, a[i] - 1)
print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

n, u, v = map(int, input().split())
# よりたかはしくんが早く辿り着ける葉のうち、青木君から最も遠いで
u -= 1
v -= 1

g = [[] for _ in range(n)]
for _ in range(n - 1):
    a, b = map(lambda x: int(x) - 1, input().split())
    g[a].append(b)
    g[b].append(a)

INF = 1 << 30
t = [INF] * n
a = [INF] * n

t[u] = 0
a[v] = 0


def dfs(v, p, d):
    for nv in g[v]:
        if nv == p:
            continue
        if d[nv] == INF:
            d[nv] = d[v] + 1
            dfs(nv, v, d)


dfs(u, -1, t)
dfs(v, -1, a)

ans = 0
for i in range(n):
    if t[i] < a[i]:
        ans = max(ans, a[i] - 1)
print(ans)
n, z, w = map(int, input().split())
l = list(map(int, input().split()))

def trial(n, z, w, t): 
  # n: 残りの枚数
  # z: Xの手持ち
  # w: Yの手持ち
  # t: これまでに引いた枚数
  min_score = [0]*n
  min_j = [0]*n
  for i in range(t,t+n):
    if i == t+n-1:
      min_score[n-1] = abs(l[t+n-1]-w)
      break
    temp = l[i]
    temp_min = 10**9+1
    for j in range(i+1, t+n):
      if abs(temp-l[j]) <= temp_min:
        temp_min = abs(temp-l[j])
        min_score[i-t] = temp_min
        min_j[i-t] = j
    #print(max(min_score))
  #print(min_score)
  #n -= (min_score.index(max(min_score))+1)
  if min_score.index(max(min_score)) == n-1:
    n = 0
    z = l[-1]
    w = w
    t = len(l)
  else:
    n = len(l) - (t+min_j[min_score.index(max(min_score))]+1)
    z = l[t+min_score.index(max(min_score))]
    w = l[t+min_j[min_score.index(max(min_score))]]
    t += (min_score.index(max(min_score))+1)
  return n, z, w, t
  
t = 0
while n > 0:
  n, z, w, t = trial(n, z, w, t)
  #print(n, z, w, t)
print(abs(z-w))

    
    
    
  

### FIXED CODE ###

n, z, w = map(int, input().split())
l = list(map(int, input().split()))

if n == 1:
  print(abs(l[0]-w))
else:
  print(max(abs(l[-1]-w), abs(l[-2]-l[-1])))
l,r=map(int,input().split());print(+(r-l<2019)and min(i*j%2019for i in range(l,r)for j in range(i+1,r)))

### FIXED CODE ###

l,r=map(int,input().split());s=range(l,r+1);print(+(r-l<2019)and min(i*j%2019for i in s for j in s if i<j))