peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
def myAnswer(N:int,A:list) -> int:
   ans = 10**9
   for i in range(1,N):
      tmp = abs(sum(A[:i]) -sum( A[i:]))
      ans = min(tmp,ans)
   return ans
   

def modelAnswer():
   tmp=1
def main():
   N = int(input())
   A = list(map(int,input().split()))
   print(myAnswer(N,A[:]))
if __name__ == '__main__':
   main()
# Judge status: Accepted
import functools,fractions
n=input()
a=list(map(int,input().split()))
print(functools.reduce(fractions.gcd,a))
# Judge status: Wrong Answer
n=int(input())

a=[]
b=[]

for _ in range(n):
    a_i ,b_i = map(int,input().split())

    a.append(a_i)
    b.append(b_i)

cnt=0

a=list(reversed(a))
b=list(reversed(b))


for i in range(n):
    fr = a[i]+cnt
    target =b[i]

    if target==1:
        continue

    num = abs(target -fr) // target

    if fr>target:
        target += target*(num+1)
    
    cnt += (target-fr)

print(int(cnt))
# Judge status: Accepted
n = int(input())
a = [int(input()) for i in range(n)]

ans = 0
tmp = 0

for i in range(n):
    ans += 1
    if a[tmp] == 2:
        break;
    tmp = a[tmp] - 1
if ans == n:
    ans = -1

print(ans)
# Judge status: Accepted
K = int(input())
S = input()
if len(S) > K:
    print(S[:K] + '...')
else:
    print(S)
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if k>=n:
    print(n*x)
else:
    print(k*x + (n-k)*y)
# Judge status: Accepted
import decimal
A, B = input().split()
A = decimal.Decimal(A)
B = decimal.Decimal(B)
print(int(A * B))
# Judge status: Accepted
sx, sy, tx, ty = map(int, input().split())
x, y = tx - sx, ty - sy
print("U"*y + "R"*x + "D"*y + "L"*x +
      "L" + "U"*(y+1) + "R"*(x+1) + "D" + "R" + "D" * (y+1) + "L" * (x+1) + "U")
# Judge status: Accepted
def kth_common_divisor(a, b, k):

    count = []
    for i in range(1, max(a, b)+1):
        if a%i == 0 and b%i == 0:
            count.append(i)

    count.sort(reverse=True)
    return count[k-1]

def main():
    a, b, k = map(int, input().split())
    print(kth_common_divisor(a, b, k))

if __name__ == '__main__':
    main()
# Judge status: Accepted
x, n = [int(i) for i in input().split(' ')]

if n:
    p = [int(i) for i in input().split(' ')]
    if x in p:
        for i in range(1, 101):
            if not x - i in p:
                print(x - i)
                exit()
            elif not x + i in p:
                print(x + i)
                exit()
    else:
        print(x)
else:
    print(x)
# Judge status: Accepted
def main():
    N, D = map(int, input().split(" "))
    print(round((D + N) / (2 * D + 1)))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n, m = map(int, input().split())
A = n * [0]
B = n * [0]
for i in range(n):
    A[i], B[i] = map(int, input().split())

M = m * [0]
cnt = 0
for i in range(n):
    if A[i] <= m:
        cnt += max(B)
        b = max(B)
        B.remove(b)
        m -= 1
    else:
        pass
print(cnt)
# Judge status: Accepted
a,b = map(int,input().split())
s = input()

def ifnum(v):
  for i in range(0,len(v)):
    if(v[i] == "0" or v[i] == "1" or v[i] == "2" or v[i] == "3" or v[i] == "4" or v[i] == "5" or v[i] == "6" or v[i] == "7" or v[i] == "8" or v[i] == "9"):
      continue
    else:
      return 0
  return 1
#print(s[a+1:])

if(ifnum(s[0:a]) == 1 and s[a] == "-" and ifnum(s[a+1:]) == 1):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n,p = map(int,input().split())
a = list(map(int,input().split()))
flg = True
for i in a:
    if i % 2 != 0:
        flg = False
        break
if flg:
    if p == 0:
        print(2**n)
    else:
        print(0)
else:
    print(2**(n-1))
# Judge status: Accepted
n, m = map(int, input().split())
a = sum(list(map(int, input().split())))
print(max(n-a, -1))
# Judge status: Accepted
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

ans = 10**9
idx = 0
for i in range(N):
  temp = T - H[i]*0.006
  diff = abs(A - temp)
  if diff < ans:
    ans = diff
    idx = i + 1
print(idx)
# Judge status: Wrong Answer
S = input()
na = S.count("a")
nb = S.count("b")
nc = S.count("c")

n_kind = len(set(S))
nall = na+nb+nc
mx = max(na,nb,nc)
mn = min(na,nb,nc)
rest = nall - mx

if len(S) == 1:
    print("YES")
    exit()
if n_kind == 2 and len(S) == 2:
    print("YES")
    exit()
if n_kind == 2 and len(S) > 2:
    print("NO")
    exit()
if n_kind == 3:
    if mx - rest >= 1:
        print("NO")
    else:
        print("YES")
# Judge status: Accepted
a,b,c = map(int,input().split())

if c >= (a+b) and 4*a*b < (c - (a+b))**2:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1, n+1):
    if i % 3 != 0 and i % 5 != 0:
        ans += i
print(ans)
# Judge status: Accepted
import queue

N, M = map(int, input().split())
graph = [[] for _ in range(N)]
for _ in range(M):
    A, B = map(int, input().split())
    graph[A-1].append(B-1)
    graph[B-1].append(A-1)

up = [-1 for _ in range(N)]
up[0] = 0

q = queue.Queue()
q.put(0)
while not q.empty():
    now = q.get()
    for x in graph[now]:
        if up[x] != -1:
            continue
        up[x] = now
        q.put(x)

print('Yes')
for i in range(1, N):
    print(up[i]+1)
# Judge status: Accepted
import numpy as np
N, M = map(int,input().split())
ansAC = 0
ansWA = 0
zeros = np.zeros(N)
is_solved = set()
for _ in range(M):
    p, S = input().split()
    p = int(p)
    if S == "WA":
        if p-1 not in is_solved:
            zeros[p-1] += 1
    else:
        is_solved.add(p-1)
ansAC = len(is_solved)
ansWA = int(sum(zeros[list(is_solved)]))
print(ansAC, ansWA)
# Judge status: Accepted
def A():
    xyz=list(map(int,input().split()))
    xyz[0],xyz[1]=xyz[1],xyz[0]
    xyz[0],xyz[2]=xyz[2],xyz[0]
    
    print(str(xyz[0])+" "+str(xyz[1])+" "+str(xyz[2]))

    
if __name__=='__main__':
    A()
# Judge status: Accepted
s = [input() for i in range(2)]

K = int(s[0])
A = int(s[1].split()[0])
B = int(s[1].split()[1])

result = True
for i in range(A, B+1):
  if i % K == 0:
    print("OK")
    result = False
    break
if(result):
  print("NG")
# Judge status: Accepted
import sys
n = int(input())
h = list(map(int,input().split()))

for i in range(1,n):
     if h[i] == h[i-1] - 1:
          h[i] += 1
     elif h[i] <= h[i-1] - 2:
          print('No')
          sys.exit()
print('Yes')
# Judge status: Accepted
n=int(input())
s=list(map(int,input().split()))
k=[0]*n
for i in s:
  k[i-1]+=1
for i in k:
  print(i)
# Judge status: Wrong Answer
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    D = int(input())
    C = [int(x) for x in input().split()]
    S = [[int(x) for x in input().split()] for _ in range(D)]


    for i in range(D):
        print(i % 26)



if __name__ == '__main__':
    main()
# Judge status: Accepted
N,T=map(int,input().split())
c=[list(map(int,input().split())) for i in range(N)]
ans=10**4
for i in range(N):
  if c[i][1]<=T:
    ans=min(ans,c[i][0])
if ans==10**4:
  ans='TLE'
print(ans)
# Judge status: Accepted
K, N = map(int, input().split())
A = list(map(int, input().split()))
B =  [[] for b in range(N)]
for i in range(N-1) :
  B[i] = A[i+1] - A[i]
B[N-1] = A[0] + K - A[N-1]
print(K - max(B))
# Judge status: Wrong Answer
import math
a,b,c,d = map(int,input().split())
e = int(c*d/math.gcd(c,d))
wa = 0
c_seki = 0
d_seki = 0
e_seki = 0
c_seki = int(b/c)-int((a-1)/c)
d_seki = int(b/d)-int((a-1)/d)
e_seki = int(b/e)-int((a-1)/e)
wa = c_seki+d_seki-e_seki
print(b-a+1-wa)
# Judge status: Wrong Answer
lc = [[int(w) for w in input().split()] for i in range(3)]
cond = False

lb = lc[0]
a2 = lc[1][0]-lb[0]
a3 = lc[2][0]-lb[0]
la = [0, a2, a3]
for i in range(3):
    for j in range(3):
        if lc[i][j] != la[i]+lb[j]:
            flag = False
            break

print("Yes" if cond else "No")
# Judge status: Wrong Answer
S = input()
leng = len(S)
ans = 0
for i in range(leng-2, 1, -2):
    if S[:(i // 2)] == S[i // 2:i]:
        ans = i
print(ans)
# Judge status: Accepted
n = list(input())
ans = 0
for i in n:
    ans += int(i)

print('Yes' if ans%9==0 else 'No')
# Judge status: Wrong Answer
a=int(input())
print(a+a**2+a**3)
print(type(a+a**2+a**3))
# Judge status: Accepted
from bisect import bisect_right

def make_divisers(n):
    upper_result = []
    lower_result = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            lower_result.append(i)

            ii = n//i
            if ii != i:
                upper_result.append(ii)

    return lower_result + upper_result[::-1]

def main():
    N, M = map(int, input().split())
    divisers = make_divisers(M)
    idx = bisect_right(divisers, M/N) - 1
    print(divisers[idx])

if __name__ == "__main__":
    main()
# Judge status: Accepted
a,b,k = map(int,input().split())
ans = []
for i in range(1,min(a,b)+1):
    if a%i == 0 and b%i == 0:
        ans.append(i)
ans = sorted(ans,reverse = True)
print(ans[k-1])
# Judge status: Accepted
n=int(input())
s=input()
t=input()
buf=n
for i in range(n):
    if s[i:]==t[:n-i]:
        buf=i
        break
print(n+buf)
# Judge status: Wrong Answer
N,M=map(int,input().split())
PY=dict()
for _ in range(M):
    P,Y=map(int,input().split())
    if((P in PY.keys())==False):
        PY[P]=[Y]
    else:
        PY[P].append(Y)
for i in PY.keys():
    for j in range(1,len(PY[i])+1):
        print('{:06}{:06}'.format(i,j))
# Judge status: Wrong Answer
s = input()
d = {'S':0,'N':0,'E':0,'W':0}
for i in s:
    d[i] += 1
ns = d['S'] > 0 ^ d['N'] > 0
ew = d['E'] > 0 ^ d['W'] > 0
if ns and ew:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
s=input();q=int(input());r,a=0,[[],[]]
for _ in range(q):
  t=input()
  if t=='1':r=-(-~r%2)
  else:a[~-r+int(t[2])].append(t[4])
print(''.join(a[~-r+1][::-1])+s[::r or 1]+''.join(a[~-r+2]))
# Judge status: Accepted
def main():
    S = input()

    s = set()
    s.add('A')
    s.add('C')
    s.add('G')
    s.add('T')

    max_count = 0

    count = 0
    for c in S:
        if c in s:
            count += 1
        else:
            max_count = max(max_count, count)
            count = 0

    max_count = max(max_count, count)
    print(max_count)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
A = input()
B = input()

if A+B == 3:
    print(3)
elif A+B == 5:
    print(1)
else :
    print(2)
# Judge status: Accepted
from itertools import product

a,b,c,d=map(int,list(input()))
op = ['+','-']
for p in product(range(2),repeat=3):
  txt=f'{a}{op[p[0]]}{b}{op[p[1]]}{c}{op[p[2]]}{d}'
  if eval(txt)==7:
    print(txt+'=7')
    exit()
# Judge status: Accepted
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

ke=[a,b,c,d,e]
m=min(ke)
if n%m==0:
  print(n//m+4)
else:
  print(n//m+5)
# Judge status: Wrong Answer
a, b = map(int,input().split())
s = input()
if len(s) == a+b+1 and s.count('-') == 1:
  print("Yes")
else:
  print("No")
  exit(0)

s1,s2 = s.split('-')
if a == len(s1) and b == len(s2):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
from math import log
X, Y = map(int,input().split())
print(int(log(Y / X, 2)) + 1)
# Judge status: Accepted
import math

h = int(input())

a = int(math.log(h, 2)) + 1

print(2 ** a - 1)
# Judge status: Accepted
N,M=map(int,input().split())
SC=[input().split() for _ in range(M)]
ans=["0"]*N
for s,c in SC:
  if ans[int(s)-1]!="0" and ans[int(s)-1]!=c:
    print(-1)
    exit()
  if N>1 and s=="1" and c=="0":
    print(-1)
    exit()
  ans[int(s)-1]=c
if ans[0]=="0" and N>1:
  ans[0]="1"
print("".join(ans))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
x = []
for i in range(n):
    x.append(a[i]-i-1)
x.sort()
if n%2 == 1:
    b = x[n//2]
else:
    b = (x[n//2-1] + x[n//2])/2
sum = 0
for i in range(n):
    sum += abs(a[i]-(b+i+1))
print(int(sum))
# Judge status: Accepted
n=int(input())
s=input()
ans=0
for i in range(n):
    sf=set(s[:i])
    sl=set(s[i:])
    ans=max(len(sf&sl),ans)
print(ans)
# Judge status: Accepted
import math


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

if C == 1 or D == 1:
    print(0)
    exit()

count_all = B - A + 1
count_c = (B // C) - math.ceil(A / C) + 1
count_d = (B // D) - math.ceil(A / D) + 1
lcm_cd = C * D // math.gcd(C, D)
count_cd = (B // lcm_cd) - math.ceil(A / lcm_cd) + 1

ans = count_all - (count_c + count_d - count_cd)
print(ans)
# Judge status: Accepted
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7


s = collections.Counter(rr())
print(min(s['0'], s['1']) * 2)
# Judge status: Accepted
def actual(K, S):
    my_range = lambda n: range(n + 1)

    count = 0

    for x in my_range(K):
        for y in my_range(K):
            z = S - (x + y)
            if 0 <= z <= K:
                count += 1
    return count

  
K, S = map(int, input().split())

print(actual(K, S))
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))

min_diff = float('inf')
a_sum = sum(a)
l_sum = 0

for i in range(N - 1):
  l_sum += a[i]
  min_diff = min(min_diff, abs(l_sum * 2 - a_sum))

print(min_diff)
# Judge status: Accepted
N, A, B = (int(i) for i in input().split())  

diff = abs(A-B)
if diff == 0:
  print(0)
elif diff % 2 == 0:
  print(diff//2)
else:
  print(min(B-A+(A-1)*2+1, B-A+(N-B)*2+1)//2)
# Judge status: Accepted
def  main():
  A = list(map(int, input().split()))
  A = sorted(A)
  if A[0] %2 == A[1] % 2:
    print(A[2]-max(A[0], A[1])+abs(A[0]-A[1])//2)
  else:
    print(1+A[2]-max(A[0], A[1])+(abs(A[0]-A[1])+1)//2)
if __name__ == "__main__":
  main()
# Judge status: Accepted
S = list(map(int, input()))

a = 0
b = 0
cnt = 0
for i in S:
  if cnt % 2 == 0:
    if i == 0:
      b += 1
    else:
      a += 1
  else:
    if i == 0:
      a += 1
    else:
      b += 1
  cnt += 1
print(min(a,b))
# Judge status: Accepted
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
x,y=map(int,input().split())
if (x in a and y in a) or (x in b and y in b):print('Yes')
else:print('No')
# Judge status: Wrong Answer
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = int(input())
n, a, b, c, d  = map(int, input().split())
a -= 1
b -= 1
c -= 1
d -= 1
s  = input()
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

is_rock2 = '##' in s[a:max([b, c, d])+1]
is_empty3 = '...' in s

joken = (not is_rock2) and (is_empty3 if c > d else 1)
print('Yes' if joken else 'No')
# Judge status: Accepted
N, x = map(int, input().split())
A = list(map(int, input().split()))
ans = 0

for i in range(N-1):
    gap = A[i] + A[i+1] - x
    if gap > 0:
        ans += gap
        A[i+1] -= gap
        if A[i+1] < 0:
            A[i+1] = 0

print(ans)
# Judge status: Accepted
a = str(input())
print("Yes" if "9" in a else "No")
# Judge status: Wrong Answer
N=int(input())
L=[]
for i in range(N):
	L.append(int(input()))
count=1
j=N-1
i=0
M=1
ans=1
for i in range(N-1):
	if L[i]<L[i+1]:
		ans=max(ans,M)
		M=1
	else:
		M+=1
ans=max(ans,M)
print(ans)
# Judge status: Wrong Answer
n,k=map(int,input().split())
a=list(map(int,input().split()))
cost=[100000]*(n)
cost[0]=0
for i in range(1, n):
  for j in range(max(i-k, 0), i+1):
    cost[i]=min(cost[i], cost[j]+abs(a[i]-a[j]))

print(cost[-1])
# Judge status: Accepted
n = int(input()) - 1
ans = []
alp = [chr(i) for i in range(97, 97+26)]
while n >= 0:
    ans.append(alp[n % 26])
    n = (n // 26) - 1

print("".join(reversed(ans)))
# Judge status: Accepted
n=int(input())
a=list(map(int, input().split()))

from collections import Counter
c=Counter(a)

ans_1=0
ans_2=0
for key in c:
    if c[key]>=2 and key>=ans_1:
        ans_1,ans_2=key,ans_1
    elif c[key]>=2 and key>=ans_2:
        ans_2=key
    if c[key]>=4 and key>=ans_2:
        ans_2=key

print(ans_1*ans_2)
# Judge status: Accepted
N, P = map(int, input().split())
A = list(map(int, input().split()))

if list(filter(lambda x:(x % 2 == 1), A)):
    print(2 ** (N -1))
else:
    if P == 0:
        print(2 ** N)
    else:
        print(0)
# Judge status: Wrong Answer
nums = list(map(int, input().split()))
nums.sort()
print((nums[0] * nums[1])/2)
# Judge status: Wrong Answer
n = int(input())
A = list(map(int, input().split()))
q = int(input())

from collections import Counter
C = Counter(A)
S = sum(A)
for i in range(q):
    b, c = map(int, input().split())
    if b in C:
        vb = C[b]
        S -= b*vb
        S += c*vb
        print(S)
        if c in C:
            C[c] += vb
        else:
            C[c] = vb
    else:
        print(S)
# Judge status: Wrong Answer
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n, m = map(int, input().strip().split())
  ls, rs = [], []
  for _ in range(m):
    l, r = map(int, input().strip().split())
    ls.append(l)
    rs.append(r)
  l = max(ls)
  r = min(rs)
  print(r - l + 1)

if __name__=='__main__':
  main()
# Judge status: Accepted
#!/usr/bin/env python3
n,m = map(int,input().split())
if m // 2 < n: ans = m//2 
else: ans = n + (m-2*n)//4
print(ans)
# Judge status: Wrong Answer
import math
N,D=map(int, input().split())

print(math.ceil(N/D))
# Judge status: Accepted
S = input()
dict = {}
for s in S:
    dict[s] = 1

keys = list(dict.keys())
for i in range(ord('a'), ord('z')+1):
    if chr(i) in keys:
        continue
    else:
        print(chr(i))
        exit()
print(None)
# Judge status: Wrong Answer
d=int(input())
if d==25:
    print("Christmas")
elif d==24:
    print("Christmas Eve")
elif d==23:
    print("Christmas Eve Eve Eve")
# Judge status: Accepted
s=input()
cnt=0
prev=''
pre_max=0
ans=0
for w in s:
    if prev==w:
        cnt+=1
    else:
        ans+=cnt*(cnt+1)//2
        if w=='<':
            shou=min(pre_max, cnt)
            ans-=shou
        pre_max=0
        pre_max+=cnt
        cnt=1
    prev=w
ans+=cnt*(cnt+1)//2
if w=='>':
    shou=min(pre_max, cnt)
    ans-=shou
print(ans)
# Judge status: Accepted
#68B Break Number
n=int(input())
maxnum=0
maxtrial=2
while maxtrial<=n:
    maxtrial*=2
print(int(maxtrial/2))
# Judge status: Accepted
N,M = (int(x) for x in input().split())
Broken = [True]*(N+1)
for TM in range(0,M):
    Broken[int(input())] = False
DP = [1]+[0]*N
for Now in range(0,N):
    for Next in range(Now+1,min(N+1,Now+3)):
        if Broken[Next]==True:
            DP[Next] = (DP[Next]+DP[Now])%1000000007
print(DP[N])
# Judge status: Wrong Answer
S = input()
S = [i for i in S]
N = len(S)
cnt = 0

for i in range(N):
    if S[i]!=S[N-i-1]:
        S[N-i-1]=S[i]
        cnt+=1
# Judge status: Wrong Answer
import numpy
a,b = map(int,input().split())

ans=a
c=a
if a==b :
  ans=a**b
else:
  for i in range(1,b-a):
    c = c+1
    ans = ans * c
pm = numpy.sign(ans)
if pm==0:
  print('Zero')
elif pm==1:
  print('Positive')
else:
  print('Negative')
# Judge status: Wrong Answer
n = int(input())
ans = []

for i in range(1, n + 1):
  cnt = 0
  for x in range(1, 65):
    for y in range(x, 65):
      for z in range(y, 65):
        if (x + y) ** 2 + (y + z) ** 2 + (z + x) ** 2 == i * 2:
          if x != y and y != z and z != x:
            cnt += 6
          elif x == y == z:
            cnt += 1
          else:
            cnt += 3
  ans.append(cnt)
for j in range(n):
  print(ans[j])
# Judge status: Accepted
S = input()
T = ["Sunny", "Cloudy", "Rainy", "Sunny"]

for i in range(len(T)):
    if S == T[i]:
        print(T[i+1])
        break
# Judge status: Accepted
S=str(input())
T=str(input())
l=len(S)

for i in range(l):
    if S==T:
        break
    S=S[l-1]+S[0:l-1]

print('Yes' if S==T else 'No')
# Judge status: Accepted
a,b,c = map(int,input().split())
ans = 0
for i in range(1,b+1):
    a0 = a*i
    if a0%b == c:
        ans = 1
if ans == 1:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
edge = [0 for x in range(n)]

if l[0] != 0:
    print(0)
    exit()

for i in l:
    edge[i]+=1

ans = 1
for i in range(1, n):
    ans *= edge[l[i] - 1]
    ans %= 998244353
print(ans)
# Judge status: Accepted
A,B = map(int,input().split())
cnt = 0
for i in range(A,B+1):
  s = str(i)
  ok = 1
  for j in range(len(s)):
    if s[j] != s[len(s)-1-j]:
      ok = 0
  if ok:
    cnt+=1
print(cnt)
# Judge status: Accepted
line = input()

if "a" in line and "b" in line and "c" in line:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b=map(int,input().split())
k=a*b
if k%2==0:
  print('Even')
else:
  print('Odd')
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    for i in range(N, 1000):
        if len(set(str(i))) == 1:
            return print(i)


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

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

H *= 30
H += 0.5 * M
M *= 6

p, q = max(H, M), min(H, M)
r = min(p-q, (360-p)+q)
c = round(math.radians(r), 40)
l = A ** 2 + B ** 2 - 2 * A * B * math.cos(c)
print(math.sqrt(l))
# Judge status: Accepted
n = input()
#隙間の数
a = len(n)-1
for i in range(2**a):
  l = ["-"]*a
  for j in range(a):
    if ((i>>j)&1):
      l[a-1-j] = "+"
#上記で全てのパターンできた。
  f = ""
  for aa,bb in zip(n,l+[""]):
    f  += (aa+bb)
  if eval(f)==7:
    print(f+'=7')
    break

#qiitaのbit全探索見ながらやった
# Judge status: Accepted
N = input()
if '7' in str(N):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n, m = map(int, input().split())
common = set(range(1, m+1))
for _ in range(n):
    a = list(map(int, input().split()))
    common&=set(a[1:])
print(len(common))
# Judge status: Accepted
import itertools 
N=int(input())
L=list(map(int,input().split()))
result=[]
for pair in itertools.combinations(L, 3):
	result.append(list(pair))
count=0
for i in range(len(result)):
	result[i].sort()
	if result[i][0]!=result[i][1] and result[i][0]!=result[i][2] and result[i][1]!=result[i][2] and (result[i][0]+result[i][1])>result[i][2]:
		count+=1
print(count)
# Judge status: Accepted
def main():
    A, B, C = map(int, input().split())
    if A + B >= C:
        print("Yes")
    else:
        print("No")
if __name__ == "__main__":
    main()
# Judge status: Accepted
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

a,b,c=nii()

if a%2==1 and b%2==1 and c%2==1:
  print(min(a*b,b*c,c*a))
else:
  print(0)
# Judge status: Wrong Answer
N = int(input())
ans = (10**N - 2*(9**N) + 8**N) % (10**9+7)
print(ans)
# Judge status: Wrong Answer
n = int(input())
b = list(map(int,input().split()))

ans = b[0]

for i in range(n-2):
  ans = ans + min(b[i],b[i+1])

if b[n-2] >= b[n-3]:
  ans = ans + b[n-2]
elif b[n-2] < b[n-3]:
  ans = ans + b[n-3]
  
print(ans)
# Judge status: Wrong Answer
D,*CS = map(int, open(0).read().split())
C = CS[:26]
S = [CS[26*i:26*(i+1)] for i in range(1, D+1)]

def imax(xs):
    m = -1
    i = 0
    for j, x in enumerate(xs):
        if x > m:
            i = j
            m = x
    return i

for d in range(D):
    i = imax(S[d])
    print(i)
# Judge status: Accepted
N = int(input())
d = [int(i) for i in input().split()]

d.sort()
#print(d)
a = d[N//2 - 1]
b = d[N//2]
#print(a,b)

print(len(range(a+1,b+1)))
# Judge status: Accepted
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]

import itertools
import math

path = 0
for ptn in itertools.permutations(range(n)):
    for i, j in zip(ptn, ptn[1:]):
        path += ((xy[i][0] - xy[j][0]) ** 2 + (xy[i][1] - xy[j][1]) ** 2) ** 0.5
ans = path / (math.factorial(n))

print(ans)
# Judge status: Accepted
q, h, s, d = map(int, input().split())
n = int(input())

ans = 0

s = min(s, 2*min(h, 2*q))

if s*2 <= d:
    ans = s*n
elif s*2 > d:
    ans = n//2*d + n%2*s

print(ans)
# Judge status: Accepted
N=int(input())
count=[0]*(N+1)
for x in range(1,100):
  for y in range(1,100):
    for z in range(1,100):
      n=x*x+y*y+z*z+x*y+y*z+z*x
      if(n<=N):
        count[n]+=1
for i in range(1,N+1):
  print(count[i])
# Judge status: Accepted
def yana(boo):
  if boo:
    print("Yes")
  else:
    print("No")
yana(int(input())>=30)