Harryxun/stf_run huggingface dataset:
#ABC-129-C
N, M = map(int, input().split())
# N, M = map(int, input().split())
a = [int(input()) for i in range(M)]

dp = [0] * (N+1)
#どうやってもスタート地点から始まるから、0に行く方法は1通りのみ
dp[0] = 1

#1が壊れていなければ1に行く方法は0->1の1通りのみ
if a[0] != 1:
    dp[1] = 1
    not_broken_stairs = set(range(2, N+1)) - set(a)
else:
    not_broken_stairs = set(range(1, N+1)) - set(a)    

#i=2or3から始まる。
#１が壊れていなければ2に行く方法は(0->2の1通り)+(1->2の1通り)で2通り。
for i in not_broken_stairs:
    dp[i] = dp[i-2] + dp[i-1]
    
print(dp[-1] % (10 ** 9 + 7))

### FIXED CODE ###

#ABC-129-C
N, M = map(int, input().split())
# N, M = map(int, input().split())
a = [int(input()) for i in range(M)]

dp = [0] * (N+1)
#どうやってもスタート地点から始まるから、0に行く方法は1通りのみ
dp[0] = 1

#1が壊れていなければ1に行く方法は0->1の1通りのみ
if 1 not in a:
    dp[1] = 1
    not_broken_stairs = set(range(2, N+1)) - set(a)
else:
    not_broken_stairs = set(range(1, N+1)) - set(a)    

#i=2or3から始まる。
#１が壊れていなければ2に行く方法は(0->2の1通り)+(1->2の1通り)で2通り。
for i in not_broken_stairs:
    dp[i] = dp[i-2] + dp[i-1]
    
print(dp[-1] % (10 ** 9 + 7))
x,y,a,b,c  = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
q = [int(i) for i in input().split()]
r = [int(i) for i in input().split()]
p = sorted(p,reverse=True)
q = sorted(q,reverse=True)
r = sorted(r,reverse=True)
chk = p[:x]+q[:y]
chk = sorted(chk,reverse=True)
for i in range(c):
  if r[i] > chk[-1+i]:
    chk[-1+i] = r[i] 
print(sum(chk))

### FIXED CODE ###

x,y,a,b,c  = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
q = [int(i) for i in input().split()]
r = [int(i) for i in input().split()]
p = sorted(p,reverse=True)
q = sorted(q,reverse=True)
r = sorted(r,reverse=True)
chk = p[:x]+q[:y]
chk = sorted(chk,reverse=True)
for i in range(c):
  if i < len(chk) and r[i] > chk[-(1+i)]:
    chk[-(1+i)] = r[i]   
print(sum(chk))
# coding: utf-8
# Your code here!

x, y, m = [int(i) for i in input().split()]

a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
num = [min(a)+min(b)]

for _ in range(m):
    tmp = [int(i) for i in input().split()]
    num.append(a[tmp[0]]-1+b[tmp[1]]-1-tmp[2])

print(min(num))

### FIXED CODE ###

# coding: utf-8
# Your code here!

x, y, m = [int(i) for i in input().split()]

a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
num = [min(a)+min(b)]

for _ in range(m):
    tmp = [int(i) for i in input().split()]
    num.append(a[tmp[0]-1]+b[tmp[1]-1]-tmp[2])

print(min(num))
N=int(input())
v=list(map(int,input().split()))
while len(v)>1:
  v=v.sort()
  v1=v[0]
  del v[0]
  v2=v[0]
  del v[0]
  v.append((v1+v2)/2)
print(v)

### FIXED CODE ###

N=int(input())
v=list(map(int,input().split()))
while len(v)>1:
  v=sorted(v)
  v_1=v.pop(0)
  v_2=v.pop(0)
  v.append((v_1+v_2)/2)
print(v[0])
def beautiful:
     a, b, c = input().split()
      if fabs(b-a) == fabs(c-b):
            print('YES')
      else:
            print('NO')

beautiful()

### FIXED CODE ###

a,b,c = map(int,input().split())
if b-a == c-b:
    print("YES")
else:
    print("NO")
import fractions
from functools import reduce
import random
import copy

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

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

if n < 100:
  for i in range(n):
    b = copy.copy(a)
    b.pop(i)
    t = gcd(b)
    if ans < t:
      ans = t
else:
  for _ in range(100):
    t = gcd(random.sample(a, 30))
    if ans < t:
      ans = t

print(ans)

### FIXED CODE ###

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

ans = (t // a) * b

print(ans)
if __name__ == '__main__':
  a = []
  for i in range(3):
    a.append(int(input()))
  print(len(set(a)))

### FIXED CODE ###

if __name__ == '__main__':
  s = input()
  a= [int(elem) for elem in s.rstrip().split(' ')]
  print(len(set(a)))
if (a==0 and b==0) or (a>=13 and b>=13):
  print("NA")
elif 0<a<=12 and 0<a<=12:
  print("AMBIGUOUS")
elif 0<a<12:
  print("MMYY")
else:
  print("YYMM")
  
  

### FIXED CODE ###

s=list(input())
s=list(map(int,s))

a=s[0]*10+s[1]
b=s[2]*10+s[3]

if (a==0 and b==0) or (a>=13 and b>=13) or (a==0 and b>=13) or (a>=13 and b==0):
  print("NA")
elif 0<a<=12 and 0<b<=12:
  print("AMBIGUOUS")
elif 0<a<=12:
  print("MMYY")
else:
  print("YYMM")
import numpy as np
S = input()
S_list = []
for i in range(len(S)):
    S_list.append(int(S[i]))
S_list = np.array(S_list)
num = 0
for i in range(len(S_list)-3):
    sum_temp = np.sum([v * np.power(10, k) for k, v in enumerate(S_list[i:i+3][::-1])])
    #print(i, i+3, sum_temp)
    k = 0
    for j in range(i+3, len(S)):
        #print(S_list[j])
        sum_temp *= 10
        sum_temp += S_list[j]
        if sum_temp % 2019 == 0:
            num += 1
print(num)

### FIXED CODE ###

S = input()
N = len(S)
mod = 2019
num = [0 for i in range(2019)]
num[0] = 1
t = 1
rem = 0

for i in reversed(S):
    rem += int(i) * t
    rem %= mod
    t *= 10
    t %= mod
    num[rem] += 1

print(int(sum([i * (i-1) / 2 for i in num])))
N = int(input())

ac = 0
wa = 0
tle = 0
re = 0

for i in range(N):
  s = input()
  
  switch(s):
    case "AC":
      ac+=1
      break
    case "WA":
      wa+=1
      break
    case "TLE":
      tle+=1
      break
    case "RE":
      re+=1
      break
      
print("AC x "+ac)
print("WA x "+wa)
print("TLE x "+tle)
print("RE x "+re)

### FIXED CODE ###

N = int(input())

ac = 0
wa = 0
tle = 0
re = 0

for i in range(N):
  s = input()
  
  if s=="AC":
    ac+=1
  elif s=="WA":
    wa+=1
  elif s=="TLE":
    tle+=1
  else:
    re+=1
      
print("AC x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))
n, *a = map(int, open(0).read().split())
a2 = sorted(a)[:-2]
for i in range(n):
    if a[i]==a2[1]:
        print(a[0])
    else:
        print(a[1])

### FIXED CODE ###

n, *a = map(int, open(0).read().split())
a2 = sorted(a)[-2:]
for i in range(n):
    if a[i]==a2[1]:
        print(a2[0])
    else:
        print(a2[1])
a, b = map(int(), input().split())

c = a * b

d = c % 2

if d == 0:
    print("Odd")
else:
    print("Even")

### FIXED CODE ###

a, b = map(int, input().split())
c = a * b
d = c % 2
if d == 0:
    print("Even")
else:
    print("Odd")
n,a,b=map(int,input().split())
ret=0
for i in range(n):
  s=str(i)
  c=list(map(int,list(s)))
  cnt=sum(c)
  if cnt>=a && cnt<=b:
    ret+=cnt
print(ret)


### FIXED CODE ###

n,a,b=map(int,input().split())
ret=0
for i in range(n+1):
  s=str(i)
  c=list(map(int,list(s)))
  cnt=sum(c)
  if cnt>=a and cnt<=b:
    ret+=i
print(ret)
import sys
from collections import deque
sys.setrecursionlimit(10**7)

n, m = [int(i) for i in sys.stdin.readline().split()]
parent = [i for i in range(n)]

graph = {j:[] for j in range(n)}
for i in range(m):
    l, r, d = [int(i) for i in sys.stdin.readline().split()]
    l -= 1
    r -= 1
    graph[l].append((r, d))
    graph[r].append((l, -d))

yet = set(list(range(n)))
x_ls = [None for i in range(n)]
x_ls[0] = 0
que = deque([0])
flg = True
while len(que) > 0:
    cur = que.popleft()
    if cur in yet:
        yet.remove(cur)
    cur_pos = x_ls[cur]
    for _next, dis in graph[cur]:
        if x_ls[_next] is None:
            x_ls[_next] = cur_pos + dis
            que.append(_next)
        else:
            if x_ls[_next] != cur_pos + dis:
                flg = False
                break
    if not flg:
        break
    if len(que) == 0 and len(yet) > 0:
        que.append(list(yet)[0])
        x_ls[list(yet)[0]] = 0
        yet.pop(0)
if flg:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

n, m = [int(i) for i in sys.stdin.readline().split()]
parent = [i for i in range(n)]

graph = {j:[] for j in range(n)}
for i in range(m):
    l, r, d = [int(i) for i in sys.stdin.readline().split()]
    l -= 1
    r -= 1
    graph[l].append((r, d))
    graph[r].append((l, -d))

already = set()
x_ls = [None for i in range(n)]
x_ls[0] = 0
stack = list(range(n))[::-1]
flg = True
while len(stack) > 0:
    cur = stack.pop(-1)
    if cur in already:
        continue
    if x_ls[cur] is None:
        cur_pos = 0
    else:
        cur_pos = x_ls[cur]
    already.add(cur)
    for _next, dis in graph[cur]:
        if x_ls[_next] is None:
            x_ls[_next] = cur_pos + dis
            stack.append(_next)
        else:
            if x_ls[_next] != cur_pos + dis:
                flg = False
                break
    if not flg:
        break
if flg:
    print("Yes")
else:
    print("No")
a=int(input())
b=int(input())
import math
if math.sqrt(a)==math.sqrt(b):
  print("EQUAL")
elif math.sqrt(a)>math.sqrt(b):
  print("GREATER")
  math.sqrt(a)<math.sqrt(b):
  print("LESS")

### FIXED CODE ###

a=int(input())
b=int(input())
import math
if math.sqrt(a)==math.sqrt(b):
  print("EQUAL")
elif math.sqrt(a)>math.sqrt(b):
  print("GREATER")
elif math.sqrt(a)<math.sqrt(b):
  print("LESS")
import math
N , M , X =  map(int,input().split())
A = {}
B = {}
ANS = 100000000000
for i in range(1,N+1):
    A[i]=list(map(int,input().split()))
for i in range(1,2**N):
    l = str(bin(i))
    n = len(l)
    ans=0
    for s in range(1,M+1):
        B[s]=0
    for k in range(1,n+1):
        if l[-k] == "1":
            ans = ans + A[k][0]
            for s in range(1,M+1):
                B[s] += A[k][s]
    if all((B[l] >= X for l in range(1,M+1))):
        ANS = min(ans,ANS)
if ANS == 100000000000:
    print("-1")
else:
    print(ANS)

### FIXED CODE ###

S = input()
T = input()
s = list(S)
t = list(T)
n = len(t)
t.pop(n-1)
if s == t:
    print("Yes")
else:
    print("No")
int('x')**3

### FIXED CODE ###

x = int(input())
print(x**3)
N,S = [int(input()) for _ in range(2)]
if N%2!=0:
  print("No")
else:
  print(S[:(N/2-1)])

### FIXED CODE ###

N = int(input())
S = input()
if N%2!=0:
  print("No")
else:
  if S[:N//2]*2 == S:print("Yes")
  else : print("No")
import sys
input = sys.stdin.readline

N = input()

print(1000 - N%1000)

### FIXED CODE ###

import sys 
input = sys.stdin.readline

N = int(input())

if N % 1000 == 0:
  print(0)
else:
  print(1000 - N%1000)
N=int(input())
while i<N+1:
    count(i)=o
    if i%2==0:
        count(i)+=1
    else:
        break
if count(a)=max(count(i)):
    print(a)
   

### FIXED CODE ###

N=int(input())
print(2**(len(bin(N))-3))
Sp = [1,2,3,4,5,6,7,8,9,10,11,12,13]
Hu = [1,2,3,4,5,6,7,8,9,10,11,12,13]
Cr = [1,2,3,4,5,6,7,8,9,10,11,12,13]
Dy = [1,2,3,4,5,6,7,8,9,10,11,12,13]

num = input()
i = 0
while i < num:
     suit, n = input()
     if suit == "S":
        Sp[n-1] = 0
     elif suit == "H":
        Hu[n-1] = 0
     elif suit == "C":
        Cr[n-1] = 0
     else:
        Dy[n-1] = 0
     i += 1

for i in Sp:
    if Sp[i] != 0:
        print "S", Sp[i]

for i in Hu:
    if Hu[i] != 0:
        print "H", Hu[i]

for i in Cr:
    if Cr[i] != 0:
        print "C", Cr[i]

for i in Dy:
    if Dy[i] != 0:
        print "D", Dy[i]

### FIXED CODE ###

Sp = [1,2,3,4,5,6,7,8,9,10,11,12,13]
Hu = [1,2,3,4,5,6,7,8,9,10,11,12,13]
Cr = [1,2,3,4,5,6,7,8,9,10,11,12,13]
Dy = [1,2,3,4,5,6,7,8,9,10,11,12,13]

num = int(input())
i = 0

while i < num:
     suit, n = raw_input().split()
     n = int(n)
     if suit == "S":
        Sp[n-1] = 0
     elif suit == "H":
        Hu[n-1] = 0
     elif suit == "C":
        Cr[n-1] = 0
     else:
        Dy[n-1] = 0
     i += 1

for i in Sp:
    if i != 0:
        print "S", i

for i in Hu:
    if i != 0:
        print "H", i

for i in Cr:
    if i != 0:
        print "C", i

for i in Dy:
    if i != 0:
        print "D", i
N = int(input())
ts = fetch_Hosu(N)

le = len(ts)
numl = [0]* 15

for i in range(15):
    tmp = int(ts[2*i+1:2*i+3])
    
    if tmp ==1:
        numl[i]  += 11
    elif tmp ==11:
        if i>1:
            numl[i-1]  += 11
        numl[i]  += 1
    else:
        numl[i]  += tmp
    
#     print(numl)

# print(numl)

for j in range(len(numl)):
    if numl[14-j]==21:
        numl[13-j]  += 11
        numl[14-j]  = 1

    if numl[14-j]==12:
        numl[14-j]  = 0
    
    if numl[14-j]==22:
        numl[14-j]  = 10
    
# print(numl)
outttt = ["{0:02d}".format(i) for i in numl]
# print(outttt)
ttt=""
for k in range(len(outttt)):
    ttt += outttt[k]

ttt += ts[-1]

# print(ttt)
tetee = str(ttt)
tpl = tetee[2:].find("1")
print(tetee[tpl+2:])

### FIXED CODE ###

N=int(input())

lr = ""
i=1

if N==0:
    print(0)

else:    
    while N!=0:
        if N%(2**i)!=0:
            lr = "1" + lr
            N = N - (-2)**(i-1)
        else:
            lr = "0" + lr

        i+=1

    print(lr)
#solve function
def solve(dates):
    counter = 0;
    start_month = dates[1]
    start_day, end_day = dates[2], 0

    for year in range(dates[0], 1000):
        for month in range(start_month, 11):
            if year%3 == 0 or month%2 == 1:
                end_day = 21
            else:
                end_day = 20

            # count days
            counter += (end_day - start_day)

            start_day = 1
        else:
            start_month = 1

    return counter


#main function
if __name__ == '__main__':
    n = int(input())

    dates = []
    tmp_dates = []
    for i in range(n):
        tmp_dates = input().split()
        for j, tmp_date in enumerate(tmp_dates):
            dates.append(int(tmp_date))

        date_count = solve(dates)
        print(date_count)

        dates.clear()

### FIXED CODE ###

#solve function
def solve(dates):
    counter = 0;
    start_month = dates[1]
    start_day, end_day = dates[2], 0

    for year in range(dates[0], 1000):
        for month in range(start_month, 11):
            if year%3 == 0 or month%2 == 1:
                end_day = 21
            else:
                end_day = 20

            # count days
            counter += (end_day - start_day)

            start_day = 1
        else:
            start_month = 1

    return counter


#main function
if __name__ == '__main__':
    n = int(input())

    dates = [0 for i in range(3)]
    tmp_dates = []
    for i in range(n):
        tmp_dates = input().split()
        for j, tmp_date in enumerate(tmp_dates):
            dates[j] = int(tmp_date)

        date_count = solve(dates)
        print(date_count)
s = list(input())
K = int(input())
l = []
l2 = []
l3 = []
l4 = []

for i in range(len(s)):
    s[i] = str(ord(s[i])-ord("a")+11)

for i in range(len(s)):
    tmp = ''
    for j in range(i, len(s)):
        tmp += s[j]
        l.append(tmp)

for i in range(len(l)):
    while True:
        if len(l[i]) == len(s)*2: break
        l[i] += '0'

for i in l:
    is_multi = 0
    i = int(i)
    for j in l2:
        if i == j:
            is_multi = 1
    if is_multi == 0:
        l2.append(i)

l2.sort()

l2 = list(str(l2[K-1]))

tmp = ''
for i in range(len(l2)):
    if l2[i] != '0':
        tmp += l2[i]

l3 = list(tmp)

i = 0
while i < len(l3):
    tmp = chr(int(l3[i] + l3[i+1]) - 11 + ord('a'))
    l4.append(tmp)
    i += 2

ans =''
for i in range(len(l4)):
    ans += l4[i]


print(ans)


### FIXED CODE ###

s = list(input())
K = int(input())

l =[]

for i in range(len(s)):
    tmp = ''
    for j in range(i, len(s)):
        if j > i + 4: break
        tmp += s[j]
        l.append(tmp)
l.sort()

l2 = []
for x in l:
    if len(l2) > 6:
        break
    if x not in l2:
        l2.append(x)


ans = l2[K - 1]

print(ans)
N, A = map(int, input().split())
x = list(map(int, input().split()))

dp = [[[0] * 2500 for i in range(51)] for i in range(51)]

dp[0][0][0] = 1
for i in range(N):
    for j in range(N):
        for k in range(2451):
            dp[i+1][j+1][k+x[i]] += dp[i][j][k]
            dp[i+1][j][k] += dp[i][j][k]

ans = 0
for i in range(1, N+1):
    ans += dp[N][i][A*i]

print(ans)

### FIXED CODE ###

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

dp = [[[0] * 2550 for i in range(55)] for i in range(55)]

dp[0][0][0] = 1
for i in range(N):
    for j in range(N):
        for k in range(2451):
            dp[i+1][j+1][k+x[i]] += dp[i][j][k]
            dp[i+1][j][k] += dp[i][j][k]

ans = 0
for i in range(1, N+1):
    ans += dp[N][i][A*i]

print(ans)
n,a,b = map(input().split())
print(n*a if n*a<b else b)

### FIXED CODE ###

n,a,b = map(int,input().split())
print(n*a if n*a<b else b)
A = int(input())
G = int(input())
 
if A[0]+A[1]+A[2] ==G[2]+G[1]+G[0]:
	print('YES')
else:
	print('NO')

### FIXED CODE ###

A = input()
G = input()
 
if A[0]+A[1]+A[2] ==G[2]+G[1]+G[0]:
	print('YES')
else:
	print('NO')
N = int(input())
A_list = list(map(int, input().split()))
B_list = list(map(int, input().split()))
C_list = list(map(int, input().split()))

out = 0
out += sum(B_list)
#print("out", out)

a_prev = 0

for index, a in enumerate(A_list):
#    print(index, a, a_prev)
    if a_prev == 0:
        a_prev = 0
    elif a - a_prev == 1:
        out += C_list[index]
    a_prev = a
    
print(out)

### FIXED CODE ###

N = int(input())
A_list = list(map(int, input().split()))
B_list = list(map(int, input().split()))
C_list = list(map(int, input().split()))

out = 0
out += sum(B_list)
a_prev = 0

for index, a in enumerate(A_list):
    if a_prev == 0:
        a_prev = 0
    elif a - a_prev == 1:
        out += C_list[a-2]
    a_prev = a
    
print(out)
# 桁dp + 二分探索
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def lunlun_num(N):
    N = str(N)
    L = len(N)

    dp = [[0]*10 for j in range(L)]
    for j in range(1,int(N[0])):
        dp[0][j] = 1

    flag = True
    for i in range(L-1):
        d = int(N[i+1])
        b = int(N[i])
        
        dp[i+1][0] += dp[i][0] + dp[i][1]
        dp[i+1][9] += dp[i][8] + dp[i][9]
        for j in range(1,9):
            dp[i+1][j] += dp[i][j-1] + dp[i][j] + dp[i][j+1]
        for j in range(1,10):
            dp[i+1][j] += 1

        if flag:
            if d < b - 1:
                flag = False
            elif d <= b + 1:
                for j in range(max(0, b-1),d):
                    dp[i+1][j] += 1
            else:
                for j in range(max(0, b-1),b+2):
                    dp[i+1][j] += 1
                    flag = False

    return sum(dp[L-1]) + 1 if flag else sum(dp[L-1])


def main():
    K = int(readline())

    # xを決め打って二分探索
    left = 0
    right = 10**10
    while left + 1 < right:
        x = (left + right) // 2

        if lunlun_num(x) >= K:
            right = x
        else:
            left = x
    
    print(right)


if __name__ == "__main__":
    main()


### FIXED CODE ###

# 累積和(1次元)を用いた解法
from itertools import accumulate
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N,M,Q,*lr = map(int, read().split())

    LR = [[0]*(N+1) for _ in range(N+1)]
    query = []
    for i, (l, r) in enumerate(zip(*[iter(lr)]*2)):
        if i < M:
            LR[l][r] += 1
        else:
            query.append((l, r))
    
    LR_acc = []
    for L in LR:
        LR_acc.append(list(accumulate(L)))
    
    for p, q in query:
        ans = 0
        for i in range(p,q+1):
            ans += LR_acc[i][q] - LR_acc[i][p-1]
        print(ans)


if __name__ == "__main__":
    main()
n, m, k = map(int, input().split(' '))
a_list = list(map(int, input().split(' ')))
b_list = list(map(int, input().split(' ')))
a_sum = 0
b_sum = sum(b_list)

j = m
best=0
for i, a in enumerate(a_list):
  a_sum+=a
  if a_sum>k:
    break
  while ((a_sum + b_sum) > k) & (j>=0):
    b_sum-=b_list[j]
    j-=1
    
  best = max(best,i+j+2)
      
  
    
print(best)

### FIXED CODE ###

n, m, k = map(int, input().split(' '))
a_list = list(map(int, input().split(' ')))
b_list = list(map(int, input().split(' ')))
sa = [0] * (n+1)
sb = [0] * (m+1)

for i in range(n):
  sa[i+1] = a_list[i] + sa[i]
for j in range(m):
  sb[j+1] = b_list[j] + sb[j]

best=0
r = m
for i, a in enumerate(sa):
  if a>k:
    break
  while ((a + sb[r]) > k) & (r>=0):
    r-=1
    
  best = max(best,i+r)
      
  
    
print(best)
N = int(input())
A = input().split()
b = [0]*8
c = 0

for a in A:
    a = int(a)
    if 1<=a<=399:
        b[0] += 1
    elif 400<=a<=799:
        b[1] += 1
    elif 800<=a<=1199:
        b[2] += 1
    elif 1200<=a<=1599:
        b[3] += 1
    elif 1600<=a<=1999:
        b[4] += 1
    elif 2000<=a<=2399:
        b[5] += 1
    elif 2400<=a<=2799:
        b[6] += 1
    elif 2800<=a<=3199:
        b[7] += 1
    elif 3200<=a:
        c += 1

if c == 0:
    print(8-b.count(0), end=" ")
else:
    print(max(8-b.count(0),1), end=" ")

print(min(8-b.count(0)+c, 9))

### FIXED CODE ###

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

if (100*a+10*b+c)%4==0:
    print("YES")
else:
    print("NO")
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect, fractions
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

n,k=map(int,input().split())
D=set(input().split())
while True:
    ns=str(n)
    for ni in ns:
        if ni in D:
            break
    else:
        print(n)
        exit()
    n+=1
    continue

    

### FIXED CODE ###

#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect, fractions
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

A=list(map(int,input().split()))
a=b=0
for ai in A:
    if ai==5:
        a+=1
    elif ai==7:
        b+=1
if a==2 and b==1:
    print("YES")
else:
    print("NO")
N = int(input())
A = int(input())
B = int(input())

print(max(N*A,B))

### FIXED CODE ###

N,A,B=map(int,input().split())
print(min(N*A,B))
N,M = map(int,input().split())
h=[]
li = input().split()
for i in li:
    heapq.heappush(h, -int(i))

for i in range(M):
    z = heapq.heappop(h) / 2
    heapq.heappush(h, z)
c=0
for i in h:
    c += int(i)
print(-c)

### FIXED CODE ###

import heapq
N,M = map(int,input().split())
h=[]
li = input().split()
for i in li:
    heapq.heappush(h, -int(i))

for i in range(M):
    z = heapq.heappop(h) / 2
    heapq.heappush(h, z)
c=0
for i in h:
    c += int(i)
print(-c)
import sys
input = sys.stdin.readline

def main():
	N = int(input())
	a = list(map(int,input().split()))
	ball = []
	ballNum = 0
	f = [0]*N

	for i in reversed(range(1,N)):
		if (sum(f[0::i+1]) % 2) != (a[i] % 2):
			f[i] = 1
			ball.append(i+1)
			ballNum +=1

	if (sum(f) % 2) != (a[0] % 2):
		f[i] = 1
		ball.append(1)
		ballNum +=1

	print(ballNum)
	print(*ball)

if __name__ == "__main__":
	main()


### FIXED CODE ###

import sys
input = sys.stdin.readline

def sumN(n,N,f):
	total = 0
	i = n
	while i < N:
		total += f[i]
		i += n+1

	if total % 2:
		return 1
	else:
		return 0

def main():
	N = int(input())
	a = list(map(int,input().split()))
	ball = []
	ballNum = 0
	f = [0]*N

	for i in reversed(range(1,N)):
		if sumN(i,N,f) != (a[i] % 2):
			f[i] = 1
			ball.append(i+1)
			ballNum +=1

	if (sum(f) % 2) != (a[0] % 2):
		f[0] = 1
		ball.append(1)
		ballNum +=1

	print(ballNum)
	print(*ball)

if __name__ == "__main__":
	main()
X,N = list(map(int,input().split()))
if N == 0:
  print(X)
  exit()
P = sorted(list(map(int,input().split())))
ans1 = P[0] - 1
ans2 = P[-1] + 1
isx = 0
for i in range(1,N+1):
  if (P[i]-X) > 0:
    if not isx:
      ans1 = X
      break
    else:
      break
  if P[i-1] != (P[i]-1):
    ans1 = P[i] -1
  if P[i] == X:
    isx = 1
    break

for i in range(1,N+1):
  if (P[-i]-X) < 0:
    if not isx:
      ans1 = X
      break
    else:
      break
  if P[-i+1] != (P[-i]+1):
    ans2 = P[-i] + 1
  if P[-i] == X:
    isx = 1
    break

if not isx:
  print(X)
  exit()

aa1 = abs(X-ans1)
aa2 = abs(X-ans2)
if aa1 == aa2:
  print(ans1)
elif aa1 > aa2:
  print(ans2)
else:
  print(ans1)


### FIXED CODE ###

X,N = list(map(int,input().split()))
if N == 0:
  print(X)
  exit()
P = sorted(list(map(int,input().split())))
ans1 = P[0] - 1
ans2 = P[-1] + 1
isx = 0
for i in range(1,N):
  if (P[i]-X) > 0:
    if not isx:
      ans1 = X
      break
    else:
      break
  if P[i-1] != (P[i]-1):
    ans1 = P[i] -1
  if P[i] == X:
    isx = 1
    break

for i in range(1,N+1):
  if (P[-i]-X) < 0:
    if not isx:
      ans1 = X
      break
    else:
      break
  if P[-i+1] != (P[-i]+1):
    ans2 = P[-i] + 1
  if P[-i] == X:
    isx = 1
    break

if not isx:
  print(X)
  exit()

aa1 = abs(X-ans1)
aa2 = abs(X-ans2)
if aa1 == aa2:
  print(ans1)
elif aa1 > aa2:
  print(ans2)
else:
  print(ans1)