peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
# A - RGB Cards
# https://atcoder.jp/contests/abc064/tasks/abc064_a

r, g, b = map(str, input().split())

i = int(r + g + b)
result = 'NO'

if i % 4 == 0:
    result = 'YES'

print(result)
# Judge status: Accepted
A, B = [int(s) for s in input().split()]

if A == 1:
  A = 14
if B == 1:
  B = 14
  
if A > B:
  print("Alice")
elif A == B:
  print("Draw")
else:
  print("Bob")
# Judge status: Accepted
A,B=map(int,input().split());S=input();print('Yes'if S[:A].isdigit()and S[A]=='-'and S[B+1:].isdigit()else'No')
# Judge status: Accepted
a, b = map(int, input().split())
Sum = 0
for i in range(b-a):
    Sum += i
print(Sum-a)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
# print(N)
# print(A)
A.sort(reverse=True)
ans = sum(A[0:N - 1])
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
p = list(map(int, input().split()))

pp = sorted(p)
ans = sum(pp[:k])
print(ans)
# Judge status: Accepted
x = list(input())
if "A" in x and "B" in x:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
S = input()
print("Yes" if all(map(lambda x: x=="", S.split("hi"))) else "No")
# Judge status: Accepted
from collections import Counter

N = int(input())
S = [list(input()) for _ in range(N)]

cnt = Counter(S[0])
for s in S[1:]:
    for t, c in cnt.items():
        cnt[t] = min(c, s.count(t))

ans = []
for s, c in cnt.items():
    ans += [s] * c

ans.sort()
print(''.join(ans))
# Judge status: Accepted
d = [chr(ord('a')+i) for i in range(26)]

S = input()

flag = True
for di in d:
    if di not in S:
        print(di)
        flag = False
        break
        
if flag:
    print('None')
# Judge status: Accepted
n=int(input())
a=[]

for i in range(n):
    s,p=input().split()
    a.append([s,100-int(p)])

city=sorted(a)   

for i in city:
    print(a.index(i)+1)
# Judge status: Accepted
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y,x%y)

a,b,k = map(int,input().split())
ans = gcd(a,b)
cnt = 1
while cnt < k:
    ans -= 1
    if a % ans == 0 and b % ans == 0:
        cnt += 1
print(ans)
# Judge status: Wrong Answer
a,b = map(int,input().split())
avg=(a+b)/2
if (a+b)%2==0:
    print(avg)
else:
    print(round(avg)+1)
# Judge status: Accepted
n ,a ,b = map(int,input().split())
x = n // (a + b)
y = n % (a + b)

if y < a:
    print(x * a + y)
else:
    print(x * a + a)
# Judge status: Accepted
import heapq

N,M=map(int,input().split())
B=list(map(int,input().split()))
def hu(n):
    return n*(-1)
A=list(map(hu,B))
heapq.heapify(A)
for i in range(M):
    x=heapq.heappop(A)/2
    heapq.heappush(A,x)
A1=list(map(int,A))
print(-sum(A1))
# Judge status: Accepted
#二回目
import fractions
a,b,c,d=map(int,input().split())
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


ans1=b
a-=1
ans2=0
ans1-=b//c
ans1-=b//d

ans1+=b//(lcm(c,d))
#print(ans1)

ans2+=a//c
ans2+=a//d
ans2-=a//(lcm(c,d))
print(ans1-(a-ans2))
# Judge status: Accepted
import math
r = int(input())
print(r*2*math.pi)
# Judge status: Accepted
#!/usr/bin/env python3
def main():
    N = int(input())
    S = input()

    res = 0
    R, G, B = S.count('R'), S.count('G'), S.count('B')
    for i in range(N - 2):
        for j in range(i + 1, N - 1):
            k = j + j - i
            if k >= N:
                continue
            if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
                res += 1
    print(R * G * B - res)


if __name__ == '__main__':
    main()
# Judge status: Accepted
# D - Megalomania

from operator import itemgetter

N = int(input())
AB = []
for i in range(N):
    a, b = map(int, input().split())
    AB.append((a, b))
AB = sorted(AB, key=itemgetter(1), reverse=True)
deadline = AB[0][1]
for i in range(N):
    deadline = min(deadline, AB[i][1]) - AB[i][0]

print('Yes' if 0 <= deadline else 'No')
# Judge status: Accepted
#!/usr/bin/env python3
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

import bisect
N = int(readline())
A = sorted(list(map(int,readline().rstrip().split())))
B = list(map(int,readline().rstrip().split()))
C = sorted(list(map(int,readline().rstrip().split())))
cnt = 0
for i in range(N):
    j = bisect.bisect_left(A,B[i])
    k = bisect.bisect_right(C,B[i])
    cnt += j*(N-k)
print(cnt)
# Judge status: Wrong Answer
n = int(input())
a = input().split()
m = 1
for i in range(n):
    if a[i] == 0:
        m = 0
        print("0")

if m == 1:
    for i in range(n):
        m = m * int(a[i])
        if m > 10**18:
            break
    if m > 10**18:
        print("-1")
    else:
        print(m)
# Judge status: Accepted
a1,a2,a3=map(int,input().split())
if a1+a2+a3>=22:
    print('bust')
else:
    print('win')
# Judge status: Accepted
a,b = (int(x) for x in input().split())
N = 0
M = 0
A = []
B = []
for i in range(0,b):
    N += a * (10 ** i)
    A.append(a)
for j in range(0,a):
    M += b * (10 ** j)
    B.append(b)
if A[0] <= B[0]:
    print(N)
else:
    print(M)
# Judge status: Accepted
def resolve():
    import sys
    input = sys.stdin.readline

    n = int(input().rstrip())
    count = 0
    for i in range(n):
        d1, d2 = [int(x) for x in input().rstrip().split(" ")]
        if d1 == d2:
            count += 1
            if count >= 3:
                print("Yes")
                return
        else:
            count = 0

    print("No")


if __name__ == "__main__":
    resolve()
# Judge status: Accepted
from collections import Counter
MOD = 998244353

N = int(input())

D = list(map(int, input().split()))

if D[0] > 0:
    print(0)
    exit()

c = Counter(D)
if c[0] > 1:
    print(0)
    exit()

ans = 1
for i in range(1, max(c)+1):
    if not c[i]:
        print(0)
        exit()
    
    ans *= pow(c[i-1], c[i], MOD) % MOD

print(ans%MOD)
# Judge status: Wrong Answer
s = int(input())

x =  s % 10**9
y = (s + x) // 10**9

print(0,0,1,10**9,x,y)
# Judge status: Accepted
N=int(input());
X=list(map(int,input().split()))
s=0;t=0;
for i in range(N):
  s+=X[i];
  t+=X[i]*X[i];
print(((s*s-t)//2)%1000000007)
# Judge status: Wrong Answer
A,B,C = map(int,input().split())
print(C - (A-B))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

cnt = 0
for i in range(N):
    cnt += min(A[i + 1], B[i])
    B[i] = max(0, B[i] - A[i + 1])
    cnt += min(A[i], B[i])
    A[i] = max(0, A[i] - B[i])
print(cnt)
# Judge status: Wrong Answer
n = int(input())

a = 1
b = n - 1
ans = int((n - 1) * (a + b) / 2)
print(ans)
# Judge status: Accepted
import math

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

sub1 = math.floor(mean)
sub2 = math.ceil(mean)

ans1 = 0
ans2 = 0

for i in range(n):
    ans1 += (a[i]-sub1)**2
    ans2 += (a[i]-sub2)**2
    
print(min(ans1,ans2))
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
s = input()
t = 0
f = 0

for i in range(len(s)):
  if (s[i] == 'a' and t < a+b):
    print('Yes')
    t += 1
  if (s[i] == 'b' and t < a+b and f < b):
    print('Yes')
    t += 1
    f += 1
  else:
    print('No')
# Judge status: Accepted
def gcd(a,b):
    return gcd(b,a % b) if b else abs(a)
def lcm(a,b):
    return (a*b) // gcd(a,b)
n = int(input())
t = []
for i in range(n):
    a = int(input())
    t.append(a)
b = t[0]
for i in range(1,n):
    b = lcm(b,t[i])
print(b)
# Judge status: Accepted
A, B, T = map(int, input().split())
c = (T+0.5) // A
print(int(B*c))
# Judge status: Accepted
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc126/tasks/abc131_b

n, l = map(int, input().strip().split())
res = n * (2 * l + n - 1) / 2
if l > 0:
    res -= l
elif l + n - 1 < 0:
    res -=  l + n - 1
print(int(res))
# Judge status: Accepted
a,b=map(int,input().split())

if a<=8 and b<=8:
	print("Yay!")
else:
	print(":(")
# Judge status: Accepted
def change_n(s,n) :
    ans = ""
    for i in s :
        ans +=chr( ord("A") + ((ord(i) - ord("A") + n) %26) )
    
    return ans


N = int(input())
S = list(input())
print(change_n(S,N))
# Judge status: Accepted
import math

n=int(input())

dic={}
for i in range(n):
    s=''.join(sorted(input()))
    if s in dic:
        dic[s] += 1
    else:
        dic[s] = 1

ans=0
for n in dic.values():
    if n>1:
        ans += math.factorial(n) // (math.factorial(n-2) * math.factorial(2))


print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = [0 for _ in range(n)]
for i in range(1, n):
    hi = h[i]
    x = 2 * 10 ** 9
    for j in range(1, min(k, i) + 1):
        x = min(x, dp[i - j] + abs(hi - h[i - j]))
    dp[i] = x
print(dp[-1])
# Judge status: Accepted
A, B, C, K = map(int, input().split())

ans = 0
a = min(A, K)
ans += a

K -= a
b = min(B, K)
K -= b

c = min(C, K)
ans -= c

print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
ans = [0] * N
res = ''

for i in range(N):
  ans[A[i] - 1] = i+1

for i in range(N-1):
  res += str(A[i])
  res += ' '
  
print(res + str(A[N-1]))
# Judge status: Wrong Answer
N, M = map(int, input().split())
S_C_list = [[int(_) for _ in input().split()] for i in range(M)]

ans = '0' * N
for i_s, i_c in S_C_list:
    if ans[i_s-1] == '0' or ans[i_s-1] == str(i_c):
        ans = ans[:i_s-1] + str(i_c) + ans[i_s:]
        continue

    ans = '-1'
    break

else:
    if N != 1 and ans[0] == '0':
        ans = '-1'

print(int(ans))
# Judge status: Wrong Answer
# ABC125C

from fractions import gcd
from functools import reduce

n = int(input())
a = list(set(map(int, input().split())))
n = len(a)
if n == 1:
    print(a[0])
elif n == 2:
    print(gcd(a[0], a[1]))
else:
    max_value = 0
    for i in range(n):
        memo = a.pop(0)
        x = reduce(gcd, a)
        if x > max_value:
            max_value = x
        a.append(memo)
    print(max_value)
# Judge status: Accepted
data = list(map(int, input().split()))

print(len(set(data)))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
alice = 0
bob = 0
for i in range(n):
  if i%2==0: alice+=a[i]
  else: bob+=a[i]
print(alice-bob)
# Judge status: Accepted
s = input()
n = len(s)
A = [0]*(n+1)

for i in range(n):
    if s[i] == '<':
        A[i+1] = A[i]+1
for i in reversed(range(n)):
    if s[i] == '>':
        A[i] = max(A[i+1]+1, A[i])
print(sum(A))
# Judge status: Wrong Answer
n,x = map(int, raw_input().split(' '))
ais = map(int, raw_input().split(' '))
count,cur,i = 0,0, 0
while(cur <= x and i < len(ais)):
  count +=1
  cur += ais[i]
  i +=1
print count
# Judge status: Wrong Answer
sSorted = sorted(input())

if sSorted =="abc":
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
def resolve():
    N, M = list(map(int, input().split()))
    base = min(N, M//2)
    if N >= M//2:
        add = (N - M//2)//2
    else:
        add = (M - N*2)//4
    print(base+add)

if '__main__' == __name__:
    resolve()
# Judge status: Accepted
n,m = map(int, input().split())
py = [[] for _ in range(n)]
for i in range(m):
    p,y = map(int, input().split())
    data = (y, i) # year, origIndx
    py[p-1].append(data)

    
xx = [[] for _ in range(m)]
for ken in range(0, n):
    py[ken].sort(key=lambda x: x[0])
    for i in range(len(py[ken])):
        x = py[ken][i]
        xx[x[1]] = "%s%s" % (str(ken+1).zfill(6), str(i+1).zfill(6))
print("\n".join(xx), end="")
# Judge status: Accepted
red,green,blue = list(map(int,input().split()))
K = int(input())

while red >= green and K > 0:
  green = green * 2
  K -= 1
  

while green >= blue and K > 0:
  blue = blue * 2
  K -= 1
  
if red < green and blue > green:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
s=input()
ans=False
for i in range(2):
  if s[i]==s[i+1]==s[i+2]:
    ans=True
if ans:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
import collections
n = int(raw_input())
ais = map(int,[raw_input() for _ in range(5)])

t =  0
def f(i, n , ais):
	if i == len(ais):
		return 0
	# how long to move n people from i to i + 1?
	q = (n + ais[i] - 1) / ais[i]
	r = 0
	return q + f(i + 1, ais[i],ais)
	
print f(0, n , ais)
# Judge status: Accepted
a,b=map(int,input().split())
if a*b%2==0:
    print("Even")
else:
    print("Odd")
# Judge status: Accepted
a, b, c = map(int, input().split())
X = max([a, b, c])
if (X == a+b+c-X):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from collections import deque
import sys
input = sys.stdin.readline
s = str(input().rstrip())
ans = deque(list(s))

f = True
q = int(input())
for i in range(q):
    q = list(map(str, input().split()))
    if int(q[0]) == 1:
        f = not f
    else:
        f_i = int(q[1])
        if (f_i == 1) ^ f:
            ans.append(q[2])
        else:
            ans.appendleft(q[2])
ans = "".join(list(ans))
if not f:
    ans = ans[::-1]
print(ans)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
ans="Yes" if abs(c-a)<=d or (abs(b-a)<=d and abs(c-b)<=d) else "No"
print(ans)
# Judge status: Accepted
N = int(input())
D = [False for _ in range(N)]
for i in range(N):
    x, y = map(int, input().split())
    if x == y:
        D[i] = True
tmp = 0
for i in range(N - 2):
    if D[i] == D[i + 1] == D[i + 2] == True:
        print('Yes')
        break
else:
    print('No')
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

cnt = 0
for a in A:
    if a % 4 == 0: cnt += 1
    elif a % 2 == 0: cnt += 0.5
print("Yes" if cnt >= N // 2 else "No")
# Judge status: Accepted
s={i:list(input()) for i in 'abc'}
now='a'
while s[now]:
    now=s[now].pop(0)
print(now.upper())
# Judge status: Wrong Answer
a,b=map(int,input().split())

if a<=0 and b>=0:
	print('Zero')
elif a>0:
	print('Positive')
else:
	if a==b:
		print('Positive')
	elif (b-a)%2==0:
		print('Negative')
	else:
		print('Pisitive')
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
ans=list("")
for i in range(n):
    ans+='1'

for i in range(n):
    ans[int(a[i])-1]=i+1

ans=str(ans)
print(ans)
# Judge status: Accepted
n, x, y = map(int,input().split())

ans = [0] * (n+10)

for i in range(1, n+1):
    for j in range(i+1, n+1):
        distance = min(abs(j-i), abs(x-i) + 1 + abs(y-j), abs(y-i) + 1 + abs(x-j))
        ans[distance] += 1
        
for i in range(1, n):
    print(ans[i])
# Judge status: Accepted
N,M=map(int,input().split())
H=list(map(int,input().split()))
A=[1]*N

for i in range(M):
  a,b=map(int,input().split())
  if H[a-1]<=H[b-1]:
    A[a-1]-=A[a-1]
  if H[a-1]>=H[b-1]:
    A[b-1]-=A[b-1]

print(sum(A))
# Judge status: Wrong Answer
yen, num = list(map(int, input().split()))
dislike = list(map(int, input().split()))
dislike.sort()
a = [1]*10
yenstr = list(str(yen))
for i in range(num):
  a[dislike[i]] = 0
#print(a)  
for i in range(yen, 10001):
  x = list(str(i))

  for j in range(len(x)):
    if a[int(x[j])] == 0:
      #print(j, 'break')
      break
  if j == len(x)-1:
    print(i)
    exit()
# Judge status: Accepted
a = int(input())
s = input()
if a >= 3200:
    print (s)
else:
    print ("red")
# Judge status: Wrong Answer
X = int(input())
if X >2000:
  print("1")
else:
  for i in range(1,20,1):
    if not (X in range(100*i,105*i +1)) == False:
      print("0")
      break
    else:
      print("1")
# Judge status: Accepted
# C - いっしょ
def main():
    import math
    _ = int(input())
    a = list(map(int, input().split()))
    t = float('inf')

    for i in range(min(a), max(a)+1):
        cnt = 0
        for j in a:
            cnt += (j-i)**2
        else:
            if cnt < t:
                t = cnt
    else:
        print(t)

    
if __name__ ==  "__main__":
    main()
# Judge status: Accepted
a,b=map(int,input().split())
s=input()
if a+b+1!=int(len(s)):
    print("No")
    exit()
for i in range(int(len(s))):
    if i==a:
        if s[i]!="-":
            print("No")
            exit()
    else:
        if s[i] not in ["0","1","2","3","4","5","6","7","8","9"]:
            print("No")
            exit()
print("Yes")
# Judge status: Accepted
#--Easy Linear Programming

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

number = 0
count = 0
if (k <= a):
    count = count + k
    print(count)
    exit()

if (k > a):
    number = number + a
    count = count + a

kk = k - number

if (kk <= b):
    print(count)
    exit()

if (kk > b):
    number = number + b

kkk = k - number

if (kkk <= c):
    count = count - kkk
    print(count)
    exit()

if (kkk > c):
    count = count - c

print(count)
# Judge status: Accepted
K, X = map(int, input().split())

left = X - K + 1
right = X + K

seq = list(range(left, right))
print(*seq)
# Judge status: Wrong Answer
n,m=map(int,input().split())
A=[]
C=[]
for i in range(n):
  a,b=map(int,input().split())
  A.append([a,b])
for j in range(m):
  c,d=map(int,input().split())
  C.append([c,d])
for i in range(n):
  dis=10**8+2
  ans=0
  for j in range(m):
    if abs(A[i][0]-C[j][0])+abs(A[i][1]-C[j][1])<dis:
      dis=abs(A[i][0]-C[j][0])+abs(A[i][1]-C[j][1])
      ans=j+1
  print(ans)
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
A, B, C = min(A, B, C), A+B+C - min(A, B, C) - max(A, B, C), max(A, B, C)
print((C - A + 1)//2 + (C - B + 1)//2 + (not (A % 2 == B % 2 == C % 2)))
# Judge status: Accepted
# 126 B

s = input()

fir = int(s[:2])
sec = int(s[2:])

if fir > 0 or sec > 0:
    if 1 <= fir <= 12 and 1 <= sec <= 12 :
        print("AMBIGUOUS")
    elif 1 <= fir <= 12: 
        print("MMYY")
    elif 1 <= sec <= 12:
        print("YYMM") 
    else:
        print("NA")
else:
    print("NA")
# Judge status: Accepted
from collections import defaultdict

def main():
    N = int(input())
    A = [int(input()) for _ in range(N)] + [0]

    ans = 0
    for i in range(N):
        ans += A[i] // 2
        if A[i] % 2 == 1:
            if A[i+1] >= 1:
                ans += 1
                A[i+1] -= 1

    print(ans)



    
    


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a,b=map(int,input().split())
if  a==b :
    print("Draw")
elif b==1 or a!=1 or a<b  :
    print("Bob")
else:
    print("Alice")
# Judge status: Accepted
k,s=map(int,input().split())

way=0

for x in range (k+1):
  for y in range (k+1):
    if 0<=s-x-y<=k:
      way+=1
      
print (way)
# Judge status: Accepted
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = list(map(int, input().split()))
val = 1000
prv = a[0]
for i in range(1,n):
    c = a[i]
    if c>prv:
        val = val + (val//prv)*c - (val//prv)*prv
    prv = c
#     print(val)
print(val)
# Judge status: Accepted
a,b,c=map(int,input().split())
amari=[]
tmp=a
while(True):
    if a%b==c:
        print("YES")
        break
    elif a%b in amari:
        print("NO")
        break
    else:
        amari.append(a%b)
        a+=tmp
# Judge status: Accepted
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,i=map(int,input().split())
N=int(input())
L=[int(input()) for i in range(N)]
if a in L and b in L and c in L:
  print('Yes')
elif d in L and e in L and  f in L:
  print('Yes')
elif g in L and h in L and  i in L:
  print('Yes')
elif a in L and d in L and  g in L:
  print('Yes')
elif b in L and e in L and  h in L:
  print('Yes')
elif c in L and f in L and  i in L:
  print('Yes')
elif a in L and e in L and  i in L:
  print('Yes')
elif c in L and e in L and  g in L:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import bisect
def resolve():
    N, M = list(map(int, input().split()))
    A = sorted(list(map(int, input().split(" "))))
    BC = sorted([list(map(int, input().split())) for _ in range(M)], key=lambda x: x[1], reverse=True)
    ptr = 0
    total = 0
    for i in range(M):
        num, val = BC[i]
        _ptr = min(ptr+num, bisect.bisect_left(A, val))
        if _ptr > ptr:
            total += val*(_ptr-ptr)
            ptr = _ptr
    total += sum(A[ptr:])
    print(total)

if '__main__' == __name__:
    resolve()
# Judge status: Wrong Answer
S=str(input())
print(S[0]+S[8]+S[10])
# Judge status: Wrong Answer
a,b,c,x,y=map(int,input().split())
ans=0
ans+=min(x,y)*min(2*c,a+b)
x-=min(x,y)
y-=min(x,y)
if x!=0:
   ans+=x*min(a,2*c) 
else:
   ans+=y*min(b,2*c)
print(ans)
# Judge status: Wrong Answer
x, y = map(int, input().split())
if y > x*4 or y < x*2 or y&2 == 1:
  print("No")
else:
  print("Yes")
# Judge status: Wrong Answer
i = input()
s = i.count("S")
n = i.count("N")
e = i.count("E")
w = i.count("W")
print(s,n,e,w)

if s == n and e == w:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

MOD  = 10**9 + 7

l = [0]*(N)
for i in range(N-1):
  l[i+1] += (l[i] +  A[i])%MOD
  
#print(l)

ans = 0
for i in  range(N-1):
  ans += (A[N-1-i] * l[N-1-i])%MOD
  
print(ans%MOD)
# Judge status: Wrong Answer
from math import log2, floor

X, Y = map(int, input().split())
print(floor(log2(Y / X) + 1))
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print(c-a+b)
# Judge status: Wrong Answer
N=input()
A=len(set(N))
print("YES" if A ==3 else "NO")
# Judge status: Accepted
a,b,c,k=map(int,input().split())
if k<=a:
    print(k)
elif k<=(a+b):
    print(a)
elif k<=(a+b+c):
    print(a-(k-a-b))
# Judge status: Accepted
#X = int(input())
def maxnumber(N, B):
  if N < B:
    return N
  a = (N // B) * B - 1
  if N == a + B:
    return N
  else:
    return a
  
A, B, N = list(map(int, input().strip().split()))
X = maxnumber(N, B)
ans = (A * X) // B - A * (X // B)
#print(X)
print(ans)
# Judge status: Accepted
A,B=map(int,input().split())
if A%3==0 or B%3==0 or (A+B)%3==0: print("Possible")
else: print("Impossible")
# Judge status: Accepted
from random import randint
d=int(input())
c=list(map(int,input().split()))
s=[list(map(int,input().split()))for _ in range(d)]
for i in range(d):print(randint(1,26))
# Judge status: Wrong Answer
import math
import fractions

def lcm(a, b):
    return a * b // fractions.gcd(a, b)

A, B, C, D = map(int, input().split())
total = B - A + 1
CD = lcm(C, D)

C_count = math.floor(B / C) - math.floor((A-1) / C)
D_count = math.floor(B / D) - math.floor((A-1) / D)
CD_count = math.floor(B / CD) - math.floor((A-1) / CD)

result = total - C_count - D_count + CD_count
# Judge status: Accepted
n = int(input())
ab = []
for _ in range(n):
    a,b = [int(x) for x in input().split()]
    ab.append([a,b])

tmp = 0
for x in ab[::-1]:
    x[0] += tmp
    if x[0] % x[1] != 0: 
        tmp += x[1] - (x[0] % x[1])

print(tmp)
# Judge status: Wrong Answer
X,Y = map(int, input().split())
ans = 2*X-Y/2
if ans >= 0 and ans%1 == 0:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
N = int(input())
A = [int(k) for k in input().split()]

import numpy as np
result = np.prod(A)
if (result > 10 ** 18):
    result = -1

print(result)
# Judge status: Accepted
A,B = map(int, input().split())
if A-1 >= B:
    print(2*A-1)
elif B-1 >=A:
    print(2*B-1)
else:
    print(A+B)
# Judge status: Accepted
# -*- coding: utf-8 -*-

N = int(input())
ans = 'No'

a = N%10
N = N//10

b = N%10
N = N//10

c = N%10
N = N//10

if a==7 or b==7 or c==7:
    ans ='Yes'

print(ans)
# Judge status: Wrong Answer
from sys import stdin

def S(): return stdin.readline().rstrip()
def I(): return int(stdin.readline().rstrip())
def LS(): return list(stdin.readline().rstrip().split())
def LI(): return list(map(int,stdin.readline().rstrip().split()))

w = S()

for i in range(len(w)):
    if w.count(w[0]) % 2 == 1:
        print('No')
        exit()

print('Yes')
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

N, R = [int(x) for x in input().split()]

if N >= 10:
    print(R)
else:
    print(R + 100 * (10 - R))
# Judge status: Wrong Answer
n=int(input())
b =list(map(int,input().split()))

res=[0] * n

for i in range(n):
    res[b[i]-1] = i+1

print(res)
# Judge status: Accepted
N,K = map(int,input().split())
H = list(map(int,input().split()))
new_H = sorted(H)
x = 0
for i in range(N-K):
    x += new_H[i]
print(x)
# Judge status: Wrong Answer
a,b=map(int,input().split())
s=input()
print(s.replace(s[b-1],s[b-1].lower()))