Harryxun/stf_run huggingface dataset:
list = map(int, raw_input().split())

if list[2] < list[0] :
    print('NO')
elif list[2] == list[0] :
    print('YES')
else:
    if (list[2] - list[0]) <= list[1] :
        print('YES')
    else:
        print('NO')


### FIXED CODE ###

# Aは猫, Bはどっちかわからん
A, B, X = map(int, input().split())

if X - A < 0:
    print('NO')
elif X - A > B:
    print('NO')
else:
    print('YES')
import math

n, x0 = map(int, input().split())
x = list(map(int, input().split())) + [x0]

x = list(set(x))
x.sort()
if len(x) >= 3:
    diff_x = [x[i+1] - x[i] for i in range(n-1)]
    ans = diff_x[0]
    for dx in diff_x[1:]:
        ans = math.gcd(ans, dx)
elif len(x) == 2:
    ans = x[1] - x[0]
else:
    ans = 0

print(ans)

### FIXED CODE ###

def gcd(a, b):
    m, n = max(a,b), min(a,b)
    while n != 0:
        m, n = n, m%n
    return m

n, x0 = map(int, input().split())
x = list(map(int, input().split())) + [x0]

x = list(set(x))
x.sort()
if len(x) >= 3:
    diff_x = [x[i+1] - x[i] for i in range(n)]
    ans = diff_x[0]
    for dx in diff_x[1:]:
        ans = int(gcd(ans, dx))
elif len(x) == 2:
    ans = x[1] - x[0]


print(ans)
n,k=map(int,input().split())
a=list(map(int,input().split()))
d=[]
t=a[0]
for i in range(1,k):
    d.append(t)
    if(a[t-1] in d):
        # d.pop()
        break
    t=a[t-1] 
idx=d.index(a[t-1])
idx=len(d[:idx])
print(d[(k-i-1)%len(d)-idx])

### FIXED CODE ###

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

s=[]
d=[-1]*(n+1)

v=1
while(d[v]==-1):
    d[v]=len(s)
    s.append(v)
    v=a[v-1]
c=len(s)-d[v]
l=d[v]

if(k<l):print(s[k])
else:
    k-=l
    k%=c
    print(s[k+l])
n, a, b, c = (int(x) for x in input().split())
d = {"A": a, "B": b, "C": c}
S = [input() for _ in range(n)]
ANS = []

for i, s in enumerate(S):
    if d[s[0]] == 0 and d[s[1]] == 0:
        print("No")
        exit()
    else:
        if d[s[0]] > d[s[1]] or (d[s[0]] == d[s[1]] == 1 and i < n and s[1] in S[i + 1]):
            d[s[1]] += 1
            d[s[0]] -= 1
            ANS.append(s[1])
        else:
            d[s[0]] += 1
            d[s[1]] -= 1
            ANS.append(s[0])
print("Yes")
for ans in ANS:
    print(ans)


### FIXED CODE ###

n, a, b, c = (int(x) for x in input().split())
d = {"A": a, "B": b, "C": c}
S = [input() for _ in range(n)]
ANS = []

for i, s in enumerate(S):
    if d[s[0]] == 0 and d[s[1]] == 0:
        print("No")
        exit()
    else:
        if d[s[0]] > d[s[1]] or (d[s[0]] == d[s[1]] == 1 and i < n - 1 and s[1] in S[i + 1]):
            d[s[1]] += 1
            d[s[0]] -= 1
            ANS.append(s[1])
        else:
            d[s[0]] += 1
            d[s[1]] -= 1
            ANS.append(s[0])
print("Yes")
for ans in ANS:
    print(ans)
x = list(map(int,input().split()))
if x[0]+x[1] == x[2] or x[1]+x[2] = x[0] or x[0]+x[2] == x[1]:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

x = list(map(int,input().split()))
a = x[0]
b = x[1]
c = x[2]

if a == b+c or b == a+c or c == a+b:
  print("Yes")
else: 
  print("No")
def fibonacci(n)
    if n == 0 or n == 1:
        return 1
    return fibonacci(n - 2) + fibonacci(n - 1)

print(fibonacci(int(input())))

### FIXED CODE ###

def fibonacci(f, n):
    if n == 0 or n == 1:
        f[n] = 1
        return f[n]
    if f[n]:
        return f[n]
    f[n] = fibonacci(f, n - 2) + fibonacci(f, n - 1)
    return f[n]

n = int(input())
f = [None for i in range(n + 1)]
print(fibonacci(f, n))
s_a = list(input())
s_b = list(input())
s_c = list(input())

S=[s_a,s_b,s_c]

order=0
while true:
    if S[order][0]=='a':
        del S[0][0]
        order=0
    elif S[order][0]=='b':
        del S[1][0]
        order=1
    else:
        del S[2][0]
        order=2

    if len(S[order]==0:
        print('A')
        exit(0)
    elif len(S[order])==0:
        print('B')
        exit(0)
    elif len(S[order])==0:
        print('C')
        exit(0)



### FIXED CODE ###

s_a = list(input())
s_b = list(input())
s_c = list(input())
x=s_a[0]

while True:
    if x=='a':
        if len(s_a)==0:
            print('A')
            exit()

        x=s_a[0]
        s_a.remove(x)


    elif x=='b':
        if len(s_b)==0:
            print('B')
            exit()
        x=s_b[0]
        s_b.remove(x)
        

    elif x=='c':
        if len(s_c)==0:
            print('C')
            exit()
        x=s_c[0]
        s_c.remove(x)
n = int(input())

if n < 105:
	print(0)
elif n == 105 or n == 106:
	print(1)
else:
	if n % 2 == 0:
		length = n / 2 - 1
	else:
		length = n / 2
	array = []
	answer = 1
	for i in range(53,length+1):
		number = i * 2 + 1
		for x in range(1,n+1):
			if number % x == 0:
				array.append(x)
		if len(array) == 8:
			answer += 1
	print(answer)

### FIXED CODE ###

n = int(input())

if n < 105:
	print(0)
elif n == 105 or n == 106:
	print(1)
else:
	if n % 2 == 0:
		length = int(n / 2) - 1
	else:
		length = int(n / 2)
	array = []
	answer = 1
	for i in range(53,length+1):
		number = i * 2 + 1
		for x in range(1,n+1):
			if number % x == 0:
				array.append(x)
		if len(array) == 8:
			answer += 1
		array.clear()
	print(answer)
n,x=map(int,input().split())
L=list(map(int,input().split()))
d=0
c=0
for i in range(1,n+2):
    if d<=x:
        c+=1
    d=d+L[i-1]
print(c)
    

### FIXED CODE ###

n,x=map(int,input().split())
L=list(map(int,input().split()))
d=0
c=0
for i in range(1,n+2):
    if d<=x:
        c+=1
    if i<n+1:
        d=d+L[i-1]
print(c)
n, m, q = map(int, input().split())
train = [tuple(map(int, input().split())) for _ in range(m)]
dp = [[0 for _ in range(n+1)] for _ in range(n+1)]
d = {}
for l in range(n):
    for r in range(l,n):
        d[(l+1,r+1)] = 0
for p, q in train:
    d[(p,q)] += 1
for l in range(1,n+1):
    dp[l][l] = d[(l,l)]
for w in range(1,n):
    for l in range(n-w):
        dp[l+1][l+w+1] = dp[l+1][l+w] + dp[l+2][l+w+1] - dp[l+2][l+w] + d[(l+1,l+w+1)]
for _ in range(q):
    l, r = map(int, input().split())
    print(dp[l][r])


### FIXED CODE ###

n, m, q = map(int, input().split())
train = [tuple(map(int, input().split())) for _ in range(m)]
quest = [tuple(map(int, input().split())) for _ in range(q)]
dp = [[0 for _ in range(n+1)] for _ in range(n+1)]
d = {}
for l in range(n):
    for r in range(l,n):
        d[(l+1,r+1)] = 0
for p, q in train:
    d[(p,q)] += 1
for l in range(1,n+1):
    dp[l][l] = d[(l,l)]
for w in range(1,n):
    for l in range(n-w):
        dp[l+1][l+w+1] = dp[l+1][l+w] + dp[l+2][l+w+1] - dp[l+2][l+w] + d[(l+1,l+w+1)]
for l, r in quest:
    print(dp[l][r])
n=int(input())
alist=list(map(int,input().split()))

allh=alist[0]^alist[1]
for i in range(n-1):
    allh = allh ^ alist[i+2]

outlist=[]
for a in alist:
    outlist.append(str(allh ^ a))
    outlist.append(" ")
outlist.pop()
print("".join(outlist))


### FIXED CODE ###

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

allh=alist[0]^alist[1]
for i in range(n-2):
    allh = allh ^ alist[i+2]

outlist=[]
for a in alist:
    outlist.append(str(allh ^ a))
    outlist.append(" ")
outlist.pop()
print("".join(outlist))
n = int(input())

data = '1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51'.split(' ,')

print(data[n])


### FIXED CODE ###

n = int(input())

data = '1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51'.split(', ')

print(data[n-1])
# -*- coding: utf-8 -*-
# from tqdm import tqdm

S = input()
N = len(S)
MOD = 10 ** 9 + 7

dp = [0] * 13 
next_dp = [0] * 13
dp[0] = 1
mul = 1
for i in range(0,N) # tqdm(range(0, N)):
    if S[N - i - 1] == '?':
        for k in range(10):
            for j in range(13):
                next_dp[(j + k * mul) % 13] += dp[j]
                next_dp[(j + k * mul) % 13] %= MOD
    else:
        for j in range(13):
            k = int(S[N - i - 1])
            next_dp[(j + k * mul) % 13] = dp[j]
            next_dp[(j + k * mul) % 13] %= MOD
    dp = next_dp
    next_dp = [0] * 13
    mul *= 10
    mul %= 13

print(dp[5])

### FIXED CODE ###

S = input()
N = len(S)
MOD = 10 ** 9 + 7

dp = [0] * 13 
dp[0] = 1
mul = 1
for i in range(0, N):
    next_dp = [0] * 13
    if S[N - i - 1] == '?':
        next_dp = [sum(dp[(j - k * mul) % 13] for k in range(10)) for j in range(13)]
    else:
        for j in range(13):
            k = int(S[N - i - 1])
            next_dp[(j + k * mul) % 13] = dp[j]
    dp = [d % MOD for d in next_dp]
    mul *= 10
    mul %= 13

print(dp[5])
MOD = 998244353
def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m


memo = [0]*(N+1)
memo[0] = memo[N] = 1
for k in range(1,N//2+1):
  v = memo[k-1]*(N-k+1)*modinv(k,MOD)
  v %= MOD
  memo[k] = memo[N-k] = v

N,A,B,K = map(int,input().split())
n = 0

for i in range(N+1):
    j = K-A*i
    if j < 0:
        break
    if (K-A*i)%B==0:
        j //= B
        n+=(memo[i]*memo[j])%998244353
        n%=998244353
print(n%998244353)

### FIXED CODE ###

N,A,B,K = map(int,input().split())
n = 0
MOD = 998244353
def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m


memo = [0]*(N+1)
memo[0] = memo[N] = 1
for k in range(1,N//2+1):
  v = memo[k-1]*(N-k+1)*modinv(k,MOD)
  v %= MOD
  memo[k] = memo[N-k] = v
for i in range(N+1):
    j = K-A*i
    if j < 0:
        break
    if j%B==0 and j/B <= N:
        j //= B
        n+=memo[i]*memo[j]
        n%=998244353
print(n%998244353)
import math
a, b = list(map(int,input().split()))
g = math.gcd(a, b)
print(a * b // g)

### FIXED CODE ###

a, b = list(map(int, input().split()))
def gcd(a, b):
  if a < b:
    a, b = b, a
  else:
    pass
  if a % b == 0:
    return b
  else:
    return gcd(b, a % b)
  
print(a * b // gcd(a, b))
N, M = map(int, input().split())
    H = list(map(int, input().split()))
    LIST = [ 1 for _ in range(N)]
    for _ in range(M):
        A, B = map(int, input().split())
        if H[A-1] >= H[B-1]: LIST[B-1] = 0
        if H[A-1] <= H[B-1]: LIST[A-1] = 0
    print(sum(LIST))


### FIXED CODE ###

N, M = map(int, input().split())
H = list(map(int, input().split()))
LIST = [ 1 for _ in range(N)]
for _ in range(M):
    A, B = map(int, input().split())
    if H[A-1] >= H[B-1]: LIST[B-1] = 0
    if H[A-1] <= H[B-1]: LIST[A-1] = 0
print(sum(LIST))
6
105 119 105 119 105 119

### FIXED CODE ###

n=int(input())
a,b=[None]*100000,[None]*100000
for i in range(100000):
    a[i]=[None]*2
    a[i][0]=0
    a[i][1]=i
    b[i]=[None]*2
    b[i][0]=0
    b[i][1]=i
l=list(map(int,input().split()))
for i in range(n//2):
    a[l[2*i]-1][0]+=1
    b[l[2*i+1]-1][0]+=1
a.sort(reverse=True)
b.sort(reverse=True)
if a[0][1]==b[0][1]:
    print(n-max(a[0][0]+b[1][0],a[1][0]+b[0][0]))
else:
    print(n-a[0][0]-b[0][0])
import sys
n,r = list(map(int, input().split()))
if n >= 10:
    print(n)
else:
    print(n - 100*(10-k))

### FIXED CODE ###

import sys
n,r = list(map(int, input().split()))
if n >= 10:
    print(r)
else:
    print(r + 100*(10-n))
import fractions

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

i = fractions.gcd(A, B)

C = []

def cal(i):
    for j in range(2, i//2+1):
        while True:
            if i%j == 0:
                i //= j
                C.append(j)
            else:
                break
    if i != 1:
        C.append(i)
        
    return set(C)

print(1+len(cal(x)))

### FIXED CODE ###

import fractions

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

x = fractions.gcd(A, B)

C = []

def cal(i):
    for j in range(2, int(-(-i**0.5//1))+1):
        while True:
            if i%j == 0:
                i //= j
                C.append(j)
            else:
                break
    if i != 1:
        C.append(i)
        
    return set(C)

print(1+len(cal(x)))
s = input()
print(''.join(s[0], len(s) - 2, s[-1]))


### FIXED CODE ###

s = input()
print('{}{}{}'.format(s[0], str(len(s) - 2), s[-1]))
import math


def sieve_of_erastosthenes(num):
    input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)]
    input_list[0] = input_list[1] = False
    input_list[2] = input_list[3] = input_list[5] = True
    sqrt = math.sqrt(num)

    for serial in range(3, num, 2):
        
        if serial >= sqrt:
            # print([i for i, b in enumerate(input_list) if b == True])
            return sum(input_list)

        for s in range(serial ** 2, num, serial): 
            input_list[s] = False


if __name__ == '__main__':
    while True:
        try:
            n = int(input())
        except:
            break

        print(sieve_of_erastosthenes(n))

### FIXED CODE ###

a = [True for i in range(1000000)]
i = 3
while i * i < 1000000:
    for j in range(3 * i, 1000000, 2 * i): a[j] = False
    i += 2
 
while True:
    try:
        n = int(input())
    except:
        break
 
    count = int(n >= 2) + sum(a[i] for i in range(3, n + 1, 2))
    print(count)
N,A=map(int,input().split())
B=sorted(list(map(int,input().split())))
for j in range(A):
    B.pop()
print(sum(B))

### FIXED CODE ###

N,A=map(int,input().split())
B=sorted(list(map(int,input().split())))
for j in range(A):
    if B!=[]: B.pop()
print(sum(B))
A = int(input())

B = int(input())

if A<10 and B<10:
	print(A*B)
else:
	print(-1)

### FIXED CODE ###

a,b=map(int,input().split())
 
if a<=9 and b <=9:
  print(a*b)
else:
  print(-1)
N, x = map(int, input().split())
arr = list(map(int, input().split()))

arr.sort()
cnt = 0
for ele in arr:
    if x < ele:
        break
    x -= ele
    cnt += 1

if cnt = N and x > 0:
    cnt -= 1

print(cnt)

### FIXED CODE ###

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

arr.sort()
cnt = 0
for ele in arr:
    if x < ele:
        break
    x -= ele
    cnt += 1

if cnt == N and x > 0:
    cnt -= 1

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

ans=0
pre=A[1]-A[0]
cool=True
for i in range(N-2):
    temp=A[i+2]-A[i+1]
    if temp==0:
        cool=True
        continue
    elif pre*temp<0 and cool:
        ans+=1
        cool=False
    else:
        cool=True
    pre=temp


print(ans+1)    
    

### FIXED CODE ###

# coding: utf-8
# Your code here!
_=int(input())
A=list(map(int,input().split()))
N=len(A)

trend=0
ans=0
for i in range(N-1):
    temp=A[i+1]-A[i]
    if trend==0:
        if temp>0:
            trend=1
            ans+=1
        elif temp<0:
            trend=-1
            ans+=1
        else:
            pass
    elif trend==1:
        if temp>0:
            pass
        elif temp<0:
            trend=0
        else:
            pass
    elif trend==-1:
        if temp>0:
            trend=0
        elif temp<0:
            pass
        else:
            pass

print(ans if trend!=0 else ans+1)
def solve(n,l,dp):
    if n<=0:
        return 0
    elif n==1:
        return abs(l[n]-l[n-1])
    if n in dp:
        return dp[n]
    dp[n]= min(abs(l[n]-l[n-1])+solve(n-1,l,dp),abs(l[n]-l[n-2])+solve(n-2,l,dp))
    return dp[n]
n=int(input())
l=[int(x) for x in input().split()]
if n==1:
    print(0)
else:
    ans=solve(n-1,l,{})
    print(ans)

### FIXED CODE ###

n=int(input())
l=[int(x) for x in input().split()]
dp=[0]*n
for i in range(n):
    if i==0:
        dp[i]=0
    elif i==1:
        dp[i]=abs(l[i]-l[i-1])
    else:
	    dp[i]=min(dp[i-1]+abs(l[i]-l[i-1]),dp[i-2]+abs(l[i]-l[i-2]))
print(dp[n-1])
#!/use/bin/env python3

(n, k) = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]

like = []

ans = n

while (1):

    c = True
    for ii in range(0, 4):
        b = n // pow(10, ii)
        d = b % 10

        if b == 0:
            break

        if d in a:
            c = False
            break

    if (c):
        ans = n
        break
    n += 1

print(ans)


### FIXED CODE ###

#!/use/bin/env python3

a = [int(s) for s in input().split()]

b, c, d = sorted(a)

if b == 5 and c == 5 and d == 7:
    print('YES')
else:
    print('NO')
n,k=map(int,input().split())
s=input()
s='0'+s+'0'
S=[]
E=[]
ans=[]
for i in range(n+1):
  if s[i:i+2]=='01':
    S.append(i+1)
  if s[i:i+2]=='10':
    E.append(i)
for j in range(len(E)-k):
  ans.append(abs(S[j]-E[j+k]))
if ans==[]:
  print(E[0])
else:
  print(max(ans)+1)

### FIXED CODE ###

n,k=map(int,input().split())
s=input()
s='01'+s+'10'
S=[]
E=[]
ans=[]
for i in range(n+3):
  if s[i:i+2]=='01':
    S.append(i+1)
  if s[i:i+2]=='10':
    E.append(i)
if S==[] and E==[]:
  print(n)
else:
  for j in range(len(E)-k):
    ans.append(abs(S[j]-E[j+k]))
  if ans!=[]:
    ans[0]-=1
    ans[len(ans)-1]-=1
    print(max(ans)+1)
  else:
    print(n)
import math
def lcm(C,D):
    return int(C*D/math.gcd(C,D))
A,B,C,D = map(int, input().split())
X = B - A + 1
print(int(X - X/C - X/D + X/lcm(C,D)))

### FIXED CODE ###

import fractions
def lcm(C,D):
    return C*D//fractions.gcd(C,D)
A,B,C,D = map(int, input().split())
b = (B - B//C - B//D + B//lcm(C,D))
a = ((A-1) - (A-1)//C- (A-1)//D + (A-1)//lcm(C,D))
print(b-a)
import numpy as np
from numba import njit

@njit(cache=True)
def light(n,a_list):
    outcome= np.zeros(n+1, dtype=np.int64)
    for i in range(n):
        outcome[max(0,i-a_list[i])] += 1
        outcome[min(n,i+a_list[i]+1)] -= 1
    outcome = np.cumsum(outcome)[:-1]
    return outcome
 
for _ in range(k):
    if min(a) == n:
        break
    a = light(n,a)
 
[print(aa,end=' ') for aa in a]

### FIXED CODE ###

name = input()
print(name[:3])
from collections import  defaultdict

s = input()
x, y = map(int, input().split())
N = len(s)

# 0: x-direction, 1: y-direction
dist = {0: [], 1: []}
current = 0
temp = 0
for move in s:
    if move == 'F':
        temp += 1
    else:
        dist[current].append(temp)
        temp = 0
        current ^= 1
if temp > 0:
    dist[current].append(temp)

xdp = {i: defaultdict(bool) for i in range(len(dist[0]))}
ydp = {i: defaultdict(bool) for i in range(len(dist[1]))}

xdp[0][dist[0][0]] = True
for i in range(1, len(dist[0])):
    d = dist[0][i]
    for j in range(-N, N+1):
        xdp[i][j] = xdp[i-1][j-d] | xdp[i-1][j+d] 

ydp[0][dist[1][0]] = True
ydp[0][-dist[1][0]] = True
for i in range(1, len(dist[1])):
    d = dist[1][i]
    for j in range(-N, N+1):
        ydp[i][j] = ydp[i-1][j-d] | ydp[i-1][j+d] 

if xdp[len(dist[0])-1][x] & ydp[len(dist[1])-1][y]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

from collections import  defaultdict

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

s_splitted = s.split('T')
x -= len(s_splitted[0])

dist = {0: [], 1: []} # 0: x-direction, 1: y-direction
for i, Fs in enumerate(s_splitted[1:]):
    dist[(i+1) % 2].append(len(Fs))

reachable = {0: set([0]), 1: set([0])}

for i in range(2):
    for d in dist[i]:
        temp = []
        for r in reachable[i]:
            temp.append(r+d)
            temp.append(r-d)
        reachable[i] = set(temp)

if x in reachable[0] and y in reachable[1]:
    print('Yes')
else:
    print('No')
a,b=map(int,input(.split()))
*aa,=map(int,input().split())
if max(aa)>=a:
    print("yes")
else:
    print('no')


### FIXED CODE ###

a,b=map(int,input().split())
l=list(map(int,input().split()))
if sum(l)>=a:
	print('Yes')
else:
	print("No")
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math

# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
def main():
    N = int(input())
    s = []
    
    for i in range(N):
        tmp = input()
        s.append(tmp)
        
    m = 0
    a = 0
    r = 0
    c = 0
    h = 0
    for i in s:
        if s[0] == "M":
            m += 1
        elif s[0] == "A":
            a += 1
        elif s[0] == "R":
            r += 1
        elif s[0] == "C":
            c += 1
        elif s[0] == "H":
            h += 1e
            
    ans = 0
    total = (a*b*c) + (a*b*d) + (a*b*e) + (a*c*d) + (a*c*e) + (a*d*e) + (b*c*d) + (b*c*e) + (b*d*e) + (c*d*e)
            
    print(total)
	
if __name__ == "__main__":
	main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math

# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
def main():
    N = int(input())
    s = []
    
    for i in range(N):
        tmp = input()
        s.append(tmp)
        
    m = 0
    a = 0
    r = 0
    c = 0
    h = 0
    for i in s:
        if i[0] == "M":
            m += 1
        elif i[0] == "A":
            a += 1
        elif i[0] == "R":
            r += 1
        elif i[0] == "C":
            c += 1
        elif i[0] == "H":
            h += 1
            
    #print("{} {} {} {} {}".format(m, a,r,c,h))
    total = (a*m*c) + (a*m*r) + (a*m*h) + (a*c*r) + (a*c*h) + (a*r*h) + (m*c*r) + (m*c*h) + (m*r*h) + (c*r*h)
            
    print(total)
	
if __name__ == "__main__":
	main()
A, B, C, X = map(int, input().split())
ans = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if X == 500*a + 100*b + 50*c:
                ans += 1
            else:
                continue
print(ans)

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if X == 500*a + 100*b + 50*c:
                ans += 1
            else:
                continue
print(ans)
a = [int(_) for _ in inpur().split()]
print(a.index(0)+1)

### FIXED CODE ###

a = [int(_) for _ in input().split()]
print(a.index(0)+1)
import sys
from math import sqrt
from math import gcd
n = int(input())
a = [int(input()) for _ in range(n+1)]
m = a[0]
for i in range(1, n+1):
	m = gcd(m, abs(a[i]))
ps = []

i = 2
while i**2 <= m:
#for i in range(2, int(sqrt(m))+1):
	if m%i == 0:
		ps.append(i)
		while m%i == 0:
			m //= i
	i += 1
if m != 1:
	ps.append(m)

prime = []
for i in range(2, n+1):
	for p in prime:
		if i%p == 0:
			break
	else:
		prime.append(i)

ps = sorted(list(set(ps + prime)))
if n == 0:
	if ps:
		print(*ps, sep="\n")
	sys.exit()
a = a[::-1]
for p in ps:
	if p-1 > n:
		ng = False
		for i in range(1, n+1):
			if a[i]%p != 0:
				ng = True
				break
		if not ng:
			print(p)
	else:
		mods = [0 for _ in range(p-1)]
		for i in range(1, n+1):
			mods[i%(p-1)] += a[i]
			mods[i%(p-1)] %= p
		if mods[0] == 0:
			ng = False
			for i in range(1, p-1):
				if mods[i] != 0:
					ng = True
					break
			if not ng:
				print(p)

### FIXED CODE ###

import sys
from fractions import gcd
n = int(input())
a = [int(input()) for _ in range(n+1)]
x = 0
while True:
	m = abs(sum([a[i]*pow(x, n-i) for i in range(n+1)]))
	if m != 0:
		break
	x += 1
ps = []

i = 2
while i**2 <= m and i <= n+1:
#for i in range(2, int(sqrt(m))+1):
	if m%i == 0:
		ps.append(i)
		while m%i == 0:
			m //= i
	i += 1
if m != 1 and n != 0:
	ps.append(m)
#print(ps)
g = a[0]
for i in range(1, n+1):
	g = gcd(g, abs(a[i]))

#print(g)
ans = []

i = 2
while i**2 <= g:
#for i in range(2, int(sqrt(m))+1):
	if g%i == 0:
		if i >= n+1:
			ans.append(i)
		while g%i == 0:
			g //= i
	i += 1
if g != 1 and g >= n+1:
	ans.append(g)

a = a[::-1]
for p in ps:
	if p-1 > n:
		ng = False
		for i in range(1, n+1):
			if a[i]%p != 0:
				ng = True
				break
		if not ng:
			ans.append(p)
	else:
		mods = [0 for _ in range(p-1)]
		for i in range(1, n+1):
			mods[i%(p-1)] += a[i]
			mods[i%(p-1)] %= p
		if mods[0] == 0:
			ng = False
			for i in range(1, p-1):
				if mods[i] != 0:
					ng = True
					break
			if not ng:
				ans.append(p)
ans = sorted(list(set(ans)))
if ans:
	print(*ans, sep="\n")