peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
S = input()
K = int(input())

N = len(S)
T = list(S)
for i in range(N - 1):
    if T[i] == 'a':
        continue
    if K >= ord('z') - ord(T[i]) + 1:
        K -= ord('z') - ord(T[i]) + 1
        T[i] = 'a'

T[N - 1] = chr(ord('a') + (ord(T[N - 1]) - ord('a') + K) % 26)
print("".join(T))
# Judge status: Wrong Answer
from collections import Counter
input = raw_input
n = int(input())
As = map(int, input().split(" "))

counter = Counter(As)
cur_sum = sum(As)


q = int(input())
bs = []
cs = []
for i in range(q):
    b, c = map(int, input().split(" "))
    bs.append(b)
    cs.append(c)

set_bc = set(bs) | set(cs)
sa = set_bc - set(counter.keys())

for key in sa:
    counter[key] = 0

for i in range(q):
    b = bs[i]
    c = cs[i]

    num1 = counter[b]
    counter[c] += num1

    diff = (c - b) * num1
    cur_sum += diff
    print(cur_sum)
# Judge status: Wrong Answer
import math
a=[]
first=[]
for i in range(5):
    temp=str(input())
    a.append(temp)
    first.append(int(temp[-1]))
nin=0
nva=9

for i in range(5):
    if first[i]!=0 and first[i]<nva:
        nin=i
        nva=first[i]

ans=0
for i in range(5):
    if i!=nin:
        temmp=int(a[i])
        temmp=math.ceil((temmp-0.5)/10)*10
        ans+=temmp
        print(temmp)
    else:
        ans+=int(a[i])
print(ans)
# Judge status: Wrong Answer
def main():
    S = input()
    ans = 1
    cp = S[0]
    for c in S[1:]:
        if c != cp:
            ans += 1
            cp = c
        else:
            cp += c
    ans = ans + 1 if len(cp) == 2 else ans
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
from fractions import gcd
n = int(input())

def lcm_base(x,y):
  return x*y//gcd(x,y)

ans =1
for i in range(n):
  a = int(input())
  ans = lcm_base(ans,a)
print(int(ans))
# Judge status: Wrong Answer
k = int(input())
n = '7'
cnt = 1
if k % 2 == 0:
    print(-1)
else:
    while cnt <= 50:
        num = int(n)
        if num%k == 0:
            break
        elif cnt == 50:
            print(k-1)
            break
        else:
            print(num%k)
            cnt += 1
            n += '7'
# Judge status: Accepted
s=input()
ok = True

if s.count('N')*s.count('S')==0 and s.count('N')+s.count('S')!=0:
    ok=False
if s.count('W')*s.count('E')==0 and s.count('W')+s.count('E')!=0:
    ok=False
    
if ok:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
s=input()
print("AC" if s[0]=="A" and s[2:-1].count("C")==1 and s[:-1].strip("A").strip("C").islower() else "WA")
# Judge status: Wrong Answer
def modpow(x, n, m):
    res = 1
    while n > 0:
        if n % 2 == 1:
            res = (res * x) % m
        x = (x * x) % m
        n >>= 1
    return res

def combination(n, r, m):
    res = 1

    for i in range(1, r + 1):
        res = (res * (n - r + i)) % m
        res = (res * pow(i, m - 2, m)) % m
    return res

mod = 10**9 + 7
n, a, b = map(int, input().split())
total = pow(2, n, mod) - 1

total -= (combination(n, a, mod) + combination(n, b, mod)) % mod

print(total)
# Judge status: Accepted
EW=0
ans=99999999999999999999999999999999

N=int(input())
S=input()

for i in range(N):
    if i==0:
        pass
    elif S[i]=="E":
        EW+=1
if ans>EW:
    ans=EW

for j in range(1,N):
    if S[j]=="E":
        EW-=1
    if S[j-1]=="W":
        EW+=1

    if ans>EW:
        ans=EW
print(ans)
# Judge status: Accepted
S = input()
print("Good" if S[0] != S[1] and S[1] != S[2] and S[2] != S[3] else "Bad")
# Judge status: Accepted
A1, A2, A3 = (int(x) for x in input().split())
if A1+A2+A3 >= 22:
    print("bust")
else:
    print("win")
# Judge status: Wrong Answer
a,b,c,d = map(int, input().split())

if a >= 0 and c >= 0:
  print(b*d)
elif b <= 0 and d <= 0:
  print(a*c)
elif a < 0 and c < 0:
  if b<0 or d<0:
    print(a*c)  
  elif abs(a)>=abs(b) and abs(c)>=abs(d):
    print(a*c)
  else:
    print(b*d)
elif (b<0 and c>=0):
  print(b*c)
elif (a>=0 and d<0):
  print(a*d)
else:
  print(b*d)
# Judge status: Accepted
n = int(input())
lst = []
for i in range(1, 10):
  for j in range(1, 10):
    lst.append(i * j)
if n in lst:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import sys
s=input()
for i in range(len(s)):
    for j in range(i,len(s)):
        t=s[:i]+s[i:]
        if s[:i]+s[j:]=="keyence": print("YES");sys.exit()
print("NO")
# Judge status: Wrong Answer
s = input()
opl = ['+', '-']

flag = [0,0,0]
for i in range(0, 0b111+1):
    for j in range(3):
        #print(i)
        flag[j] = (i>>(j+1) & 1)
        ans = s[0] + opl[flag[0]] + s[1] + opl[flag[1]] + s[2] + opl[flag[2]] + s[3]
        if(eval(ans) == 7):
            print(ans + '=7', end='')
            break
    else:
        continue
    break
# Judge status: Wrong Answer
import sys
import math

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())

a, b = nm()

n = math.gcd(a,b)

m = int(n**(1/2))

print(n)

count = 1 # 1
for i in range(2, n+1):
    if n%i ==0:
        count +=1
        while n%i == 0:
            n = n/i
    if n ==1:
        break

print(count)
# Judge status: Accepted
N,M=map(int,input().split())
balls=[1 for _ in range(N)]
answers=[0 for _ in range(N)]
answers[0]=1
for _ in range(M):
    x,y=map(int,input().split())
    balls[x-1]-=1
    balls[y-1]+=1
    if balls[x-1]>=1 and answers[x-1]==1:
        answers[y-1]=1
    elif balls[x-1]==0 and answers[x-1]==1:
        answers[x-1]=0
        answers[y-1]=1
print(sum(answers))
# Judge status: Wrong Answer
N = int(input())
l = list(map(int,input().split()))
ans = 0
if N < 3 :
    print(ans)
for m in range(N-2) :
    for n in range(m+1,N-1) :
        for k in range(n+1,N) :
            if len(set([l[m],l[n],l[k]])) == 3 and 2 * max(l[m],l[n],l[k]) < sum([l[m],l[n],l[k]]) :
                ans += 1
            else :
                continue
print(ans)
# Judge status: Accepted
def main():
    islands, regular_boat = map(int, input().split())
    departure_from_island1 = []
    arrive_to_islandN = []
    for _ in range(regular_boat):
        start, final = map(int, input().split())
        if start == 1 and final == islands:
            continue
        elif start == 1:
            departure_from_island1.append(final)
        elif final == islands:
            arrive_to_islandN.append(start)
    print("POSSIBLE" if len(set(departure_from_island1) & set(arrive_to_islandN)) > 0 else "IMPOSSIBLE")


if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
a.sort()
k=max(a)

num_list=set()
prime_list=set()

from collections import Counter
dic=Counter(a)
a=set(a)

for i in dic:
  if dic[i]>=2:
    dic[i]=0
  if i not in num_list:
    for j in range(i*2,k+1,i):
      if j in a:
        dic[j]=0
        num_list.add(j)

print(sum(dic.values()))
# Judge status: Accepted
W, H, N = map(int, input().split())
x0, y0 = 0, 0

for _ in range(N):
    xi, yi, a = map(int, input().split())
    if a == 1:
        x0 = max(xi, x0)
    elif a == 2:
        W = min(xi, W)
    elif a == 3:
        y0 = max(yi, y0)
    elif a == 4:
        H = min(yi, H)

ans = (W-x0)*(H-y0)
print(ans if x0 < W and y0 < H else 0)
# Judge status: Accepted
k=int(input())

e=k//2
o=(k+1)//2

print(e*o)
# Judge status: Wrong Answer
N, K, S = map(int, input().split())

ans = ""
cnt = 0
for i in range(N):
  if cnt < K:
    ans += str(S) + " "
    cnt += 1
  else:
    if i == N-1:
      ans += str(S+1)
    else:
      ans += str(S+1) + " "
    
print(ans)
# Judge status: Accepted
n=int(input())
p=list(map(int,input().split()))
ans=0
for i in range(1,n-1):
  if max(p[i-1],p[i],p[i+1])!=p[i] and min(p[i-1],p[i],p[i+1])!=p[i]:
    ans+=1
print(ans)
# Judge status: Accepted
S = input()
i = 0
length = len(S)
ans = 0
flag = False
while True:
	if S[i] == S[i+1]:
		if flag == False:
			i+=2
			flag = True
		else:
			i+=1
			flag = False
	else:
		i+=1
		flag = False
	ans+=1
	if i == length - 1:
		ans += 1
		break
	if i >= length:
		break
print(ans)
# Judge status: Accepted
n,m = map(int, input().split())

if n*2 <= m:
    ma = m-n*2
    ans = n+(ma//4)
    
else:
    ans = m//2

print(ans)
# Judge status: Accepted
H,N = map(int,input().split())
A = list(map(int,input().split()))
if H <= sum(A):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
from itertools import permutations

n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

if p == q:
    print(0)

for i, x in enumerate(permutations([i+1 for i in range(n)])):
    if x == p:
        a = i
    if x == q:
        b = i
print(abs(a-b))
# Judge status: Wrong Answer
n=int(input())
c=[]
sf=[]
for _ in range(n-1):
    ci,s,f=map(int,input().split())
    c.append(ci)
    sf.append([s,f])
for i in range(n):
    temp=0
    for j in range(i,n-1):
        if temp<=sf[j][0]:
            temp=sf[j][0]+c[j]
        else:
            temp=temp+temp%sf[j][1]+c[j]
    print(temp)
# Judge status: Accepted
N,M=map(int,input().split())
A = [-1]*N
for _ in range(M):
  s,c=map(int,input().split())
  s = s-1
  if A[s] != -1 and A[s] != c:
    print(-1)
    exit()
  A[s] = c

if N == 1:
  if A[0]==-1:
    print(0)
  else:
    print(A[0])
  exit()

if A[0] == 0:
  print(-1)
  exit()
if A[0] == -1: A[0] = 1
for i,a in enumerate(A):
  if a == -1:
    print(0,end='')
  else:
    print(a,end='')
# Judge status: Wrong Answer
import copy
s = list(input())
c = copy.copy(s)
n = len(s)
cnt1 = cnt2 = 0
for i in range(n-1):
    if c[i+1]==c[i]:
        cnt1 += 1
        c[i+1] = '0' if c[i+1]=='1' else '1'
s[0] = '0' if s[0]=='1' else '1'
for i in range(1,n):
    if s[i-1]==s[i]:
        cnt2 += 1
        s[i] = '0' if s[i]=='1' else '1'
print(min(cnt1,cnt2))
# Judge status: Accepted
A,B,K=map(int,input().split())
if K>=A+B:
    print(0,0)
elif K>=A:
    print(0,A+B-K)
else:
    print(A-K,B)
# Judge status: Accepted
n = int(input())
al = list(map(int, input().split()))
ans = [0] * n
for i in range(n):
    ans[al[i] - 1] = i + 1
print(*ans)
# Judge status: Wrong Answer
x = input().split()
c  =int(x[0])
v = input().split()
f = 0
for i in v:
  f += int(i)
m = c - f
print(m)
# Judge status: Wrong Answer
n,m = map(int, input().split())
h = [int(_) for _ in input().split()]
l=['']*n
for x in range(m):
    a,b = map(int, input().split())
    if h[a - 1] >= h[b - 1]:
        l[a - 1] = 'good'
    else:
        l[b - 1] = 'good'
print(l.count('good'))
# Judge status: Accepted
import heapq
n,m=map(int,input().split())
a=list(map(lambda x:int(x)*(-1), input().split()))
heapq.heapify(a)
for i in range(m):
  d=heapq.heappop(a)*(-1)
  heapq.heappush(a,(-1)*(d//2))
print(-sum(a))
# Judge status: Wrong Answer
n = int(input())
l = sorted(list(map(int, input().split())))

a = 0
        
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            if l[k] < l[i] + l[j] and l[i] < l[j] and l[j] < l[k]:
                a += 1

print(a, l)
# Judge status: Accepted
k, n = map(int, input().split())
li = list(map(int, input().split()))
li_2 = []
for i in range(1,len(li)):
  li_2.append(li[i]-li[i-1])
print(min(k-max(li_2), li[-1]-li[0]))
# Judge status: Wrong Answer
s = input ()
n = len (s)
print (n)
for i in range (n):
  if s[i] == 'A':
    x = i
    break
for i in range (n):
  print (s[-1-i])
  if s[-1-i] == 'Z':
    y = n-i-1
    break
print (x,y)
print (y-x+1)
# Judge status: Accepted
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
print(sum(p[0 : k]))
# Judge status: Accepted
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    X = list(map(int, input().split()))

    Y = sorted(X)
    A, B = Y[N // 2 - 1: N // 2 + 1]
    for x in X:
        if x <= A:
            print(B)
        else:
            print(A)


if __name__ == "__main__":
    main()
# Judge status: Accepted
k = int(input())
from math import gcd

ans = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for l in range(1, k+1):
            ans += gcd(i,gcd(j,l))

print(ans)
# Judge status: Accepted
n=int(input())
A=[]
B=[]
for i in range(n):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
A.sort()
B.sort()
if n%2==0:
    a_min=(A[n//2-1]+A[n//2])/2
    b_max=(B[n//2-1]+B[n//2])/2
    print(int(1+(b_max-a_min)/0.5))
else:
    a_min=A[n//2]
    b_max=B[n//2]
    print(int(b_max-a_min)+1)
# Judge status: Wrong Answer
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    a, b, c = Input()
    ans = a - (b+c)
    print(ans if ans >= 0 else 0)


main()
# Judge status: Wrong Answer
N, M = map(int,input().split())

n = N-1
m = M-1

Even = N*n
Odd = M*m

print((Even+Odd)/2)
# Judge status: Accepted
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = [ir() for _ in range(N)]
top = max(A)
if A.count(top) == 1:
    second = sorted(A, reverse=True)[1]
    for i in range(N):
        if A[i] == top:
            print(second)
        else:
            print(top)
else:
    for i in range(N):
        print(top)
# 23
# Judge status: Accepted
s=input()
print(len(s)-s[::-1].index("Z")-s.index("A"))
# Judge status: Wrong Answer
N = input()

a = 0
for i in range(len(N)):
    a = max(a,int(N[i]))

ans = ""
for i in range(len(N)):
    ans += str(a)

print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
a = list(map(int, input().split()))
print(n-sum(a) if n >= sum(a) else -1)
# Judge status: Wrong Answer
N, M = map(int, input().split())

A = []
for i in range(N):
    A.append(list(map(int, input().split())))

s = set(A[0])
for i in range(1,N):
    _s = set(A[i])
    s &= _s
    
ans = len(s)-1
print(ans-1 if ans > 0 else 0)
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

ans = 0
i = 1
while i != 2:
    i = a[i-1]
    #print(i)
    ans += 1
    if ans >= n:
        print(-1)
        sys.exit()
print(ans)
# Judge status: Accepted
n,m = tuple(map(int,input().split()))

if m-2*n>0:
  rest = m-2*n
  print(n+rest//4)
else:
  print(m//2)
# Judge status: Accepted
n=int(input())
for i in range(n,1000):
  s=set(list(str(i)))
  if len(s)==1:
    print(i)
    exit()
# Judge status: Wrong Answer
from itertools import product
import numpy as np
a = int(input())
b = int(input())
c = int(input())
x = int(input())

a = ', ' + ', '.join([str(sum(el)) for el in 
               product(
                   np.arange(a+1)*500, np.arange(b+1)*100, np.arange(c+1)*50
               )
                     
                      if not sum(el)==0 
               ]) + ', '
print(a.count(
    ', {},'.format(x)
))
# Judge status: Wrong Answer
N, M = map(int, input().split())
node =[[] for _ in range(N)]

for _ in range(M):
  x, y = map(int, input().split())
  node[x-1].append(y-1)
  node[y-1].append(x-1)

ct = [-1]*N

i = 0
stack = []
ct[0] = 0
stack.append(0)
while len(stack) != 0:
  v = stack.pop()
  for e in node[v]:
    if ct[e] == -1:
      ct[e] = v
      stack.append(e)

print('Yes')
for i in range(1,N):
  print(ct[i]+1)
# Judge status: Accepted
n=int(input())
x=list(map(int,input().split()))
med=((n+1)//2)-1
medi=(n+1)//2
s=sorted(x)
for i in range(n):
    if x[i]<=s[med]:
        print(s[medi])
    else:
        print(s[med])
# Judge status: Accepted
N = int(input())
a = [0]*N
for i in range(N):
  a[i] = int(input())
b = sorted(a,reverse=True)
for i in range(N):
  if a[i] == b[0]:
    print(b[1])
  else:
    print(b[0])
# Judge status: Wrong Answer
x,y,z=map(int,input().split())
print(x//((y+z)+z))
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if a+b == c or b+c == a or c+a == b:
    print("Yes")
else:
    print
    ("No")
# Judge status: Accepted
n = int(input())

pf = {}


for i in range(2,int(n**0.5)+1):
    while n%i == 0:
        pf[i] = pf.get(i,0)+1
        n //= i
if n>1: pf[n] = 1

num_group = [0]*11 #2**50 > 10**12  55=1+2+...+10
for i in range(10):
    num_group[i+1] = num_group[i] + (i+1)
#print(num_group)

ans = 0
for prime in pf.keys():
    for i in range(1,11):
      if pf[prime]<num_group[i]:
          break
    ans += i-1
print(ans)
# Judge status: Accepted
p,r=input,range
A=sum([list(map(int,p().split()))for _ in r(3)],[])
b=[int(p())for _ in r(int(p()))]
print('YNeos'[all([sum(1<<i for i in r(9)if A[i]in b)&v!=v for v in[7,56,73,84,146,273,292,448]])::2])
# Judge status: Accepted
N = int(input())

res=0
for i in range(1, N+1):
    if(len(str(i)) % 2==1):
        res+=1

print(res)
# Judge status: Accepted
m=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
N=int(input())
s=input()
ans=[]
for i in range(len(s)):
    index=m.index(s[i])
    if index+N>=26:
        ans.append(m[index+N-26])
    else:
        ans.append(m[index+N])
print(*ans, sep='')
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()

S = list(input())
n = len(S)

dp = [0] * 2019
dp[0] = 1
tmp = 0
ten = 1
for i in range(n):
    tmp += int(S[n-1-i]) * ten
    tmp %= 2019
    ten *= 10
    ten %= 2019
    dp[tmp%2019] += 1
# print(dp)

ans = 0
for i in dp:
    if i >= 2:
        ans += i*(i-1)//2
        # print(i, dp[i])
print(ans)
# Judge status: Accepted
A = [int(input()) for _ in range(5)]
tmp = 10

for i in range(5):
    if A[i] % 10 != 0:
        tmp = min(tmp, A[i] % 10)
        A[i] = A[i] // 10 * 10 + 10

print(sum(A) - (10 - tmp))
# Judge status: Accepted
n, k = map(int, input().split())
lst = list(map(int, input().split()))


for i in range(n-k):
    if lst[i] < lst[i+k]:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
a, b, c, k = map(int, input().split())

if a > k:
  print(k)
elif a+b > k:
  print(k)
else:
  print(a -(k-a-b))
# Judge status: Accepted
X=int(input())
for x in range(X,2*X):
    for i in range(2,int(x**.5)+1):
        if x%i==0:
            break
    else:
        print(x)
        break
# Judge status: Accepted
S = input()
count = 0

for i in range(len(S)//2):
    if S[i] != S[-i-1]:
        count += 1
print(count)
# Judge status: Accepted
n,q = map(int,input().split())
s = "p" + str(input())
lr = [list(map(int,input().split())) for i in range(q)]
cnt = 0
ans = [0] * (n+1)
for i in range(1,n+1):
    if s[i-1] == "A" and s[i] == "C":
        cnt += 1
    ans[i] = cnt
for i in lr:
    print(ans[i[1]] - ans[i[0]])
# Judge status: Wrong Answer
n,m,k=map(int,input().split())
ans="No"
for i in range(n):
  if (2*i-n)==0:
    if k==m*n//2:
      ans="Yes"
  else:
    if (k-n*m+m*i)%(2*i-n)==0 and 0<(k-n*m+m*i)//(2*i-n)<m:
      ans="Yes"
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
n, p, *a = map(int, open(0).read().split())
dp = [0] * (n + 1)
dp[0] = 1 if p == 0 else 0
for i in range(1, n + 1):
    if a[i - 1] % 2:
        dp[i] = 2**(i - 1)
    else:
        dp[i] = 2 * dp[i - 1]
print(dp[n])
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))

count = 0
maxcount = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        count += 1
        maxcount = max(count, maxcount)
    else:
        count = 0

print(maxcount)
# Judge status: Accepted
import sys
A,B,K = map(int,input().split())
if not ( 1 <= A <= 100 and 1 <= B <= 100 ): sys.exit()
if not ( 1 <= K ): sys.exit()
#euclid algorithm
if A < B: 
    A, B = B, A
while A%B != 0:
    A,B = B,A%B
# B is greatest common divisor
count = 0
for I in range(B,0,-1):
    if B % I == 0:
        count += 1
    if count == K:
        print(I)
        break
# Judge status: Accepted
from collections import defaultdict
N = int(input())
d = defaultdict(int)
for _ in range(N):
    a = int(input())
    d[a] = (d[a]+1)%2
print(sum(d.values()))
# Judge status: Accepted
from collections import Counter
n = int(input())
dic = Counter(["".join(sorted(list(input()))) for _ in range(n)])
ans = 0
for j in dic.values():
    if j >= 2:
        ans += j * (j-1) // 2
print(ans)
# Judge status: Wrong Answer
ab = list(map(str, input().split()))
ab = int("".join(ab))
for i in range(1, 200):
    if i * i == ab:
        print("Yes")
        exit()
else:
    print("No")
# Judge status: Accepted
import sys

s = input()
text1 = 'R U D'
text2 = 'L U D'

for i, num in enumerate(s):
  if(i % 2 == 0):
    if(num in text1):
      continue
    else:
      print('No')
      sys.exit()
  else:
    if(num in text2):
      continue
    else:
      print('No')
      sys.exit()

print('Yes')
# Judge status: Wrong Answer
k, s = map(int, input().split())
r = range(0, k + 1)
cnt = 0
for x in r:
    for y in r:
        if x + y > s: continue
        for z in r:
            if x + y + z == r:
                cnt += 1
                
print(cnt)
# Judge status: Accepted
n = int(input())
s = input()
new_s = []
for c in s:
 a = chr((ord(c)-ord("A")+n)%26+ord("A"))
 new_s.append(a)

print("".join(new_s))
# Judge status: Accepted
a = input()
ans = a.upper()
if a == ans:
  print("A")
else:
  print("a")
# Judge status: Accepted
a,b,c = map(int,input().split())
print(max(0,c-(a-b)))
# Judge status: Accepted
n, m = map(int,input().split())
a = list(input().split() for i in range(m))

wa = [0]*n
ac = [0]*n

for b in a:
  p = int(b[0]) - 1
  if ac[p] == 1:
    next
  else:
    if b[1] == 'AC':
      ac[p] = 1
    else:
      wa[p] += 1
wa = [ac[i]*wa[i] for i in range(n)]
print('{} {}'.format(sum(ac),sum(wa)))
# Judge status: Accepted
from collections import Counter
n = int(input())
A = list(map(int, input().split()))
C = Counter(A)
ans = 0
for k, v in C.items():
  if v >= k:
    ans += v-k
  else:
    ans += v
print(ans)
# Judge status: Accepted
a = int(input())
print(a + a*a + a*a*a)
# 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())
rf = lambda: map(float, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

x, y = rm()
if x%y == 0:
    print(-1)
else:
    print(x)
# Judge status: Accepted
def gcd(a, b):
    while(b > 0):
        a = a%b
        c = b
        b = a
        a = c
    return a

n = int(input())
s = input()

s = s.split(" ")
# for i s:
#     x = int(input())
#     arr.append(x)

l = int(s[0])

for i in range(1, n):
    l = (l*int(s[i]))//gcd(l, int(s[i]))

ans = 0
for x in s:
    x = int(x)
    ans += l//x

print(ans%1000000007)
# Judge status: Accepted
s = list(input())
for i in s[::2]:
    if i == 'L':
        print('No')
        exit()
for j in s[1::2]:
    if j == 'R':
        print('No')
        exit()
print('Yes')
# Judge status: Wrong Answer
import collections
N = int(input())

a = collections.Counter(list(map(int,input().split())))
#a = sorted(a.items(), key=lambda x: -x[0],reverse=True)
#for k, v in sorted(a.items(), key=lambda x: -x[0]):pass
a = sorted(a.items(), key=lambda x:x[0],reverse=True)

#print(a)

cnt = 0
num = []
n = 0
for i,v in a:
    if 4 <= v:
        n = max(n,(i*i))
    elif 2 <= v:
        num.append(i)
        cnt += 1
    if 2 == cnt:
        break

if cnt == 2:
    print(max(num[0]*num[1],n))
else:
    print(0)
# Judge status: Wrong Answer
#C - Count Order
import math
import itertools

N = int(input())
P = tuple(map(int,input().split()))
Q = tuple(map(int,input().split()))

li = list(itertools.permutations(P,N))
li.sort()

a = 0
b = 0

for i in range(math.factorial(N)):
    if li[i] == P:
        a = i
    elif li[i] == Q:
        b = i
    else:
        a = a
        b = b
        
print(abs(a-b))
# Judge status: Wrong Answer
import math
n,*l=map(int,open(0).read().split())
print(4+math.ceil(n/min(l)))
# Judge status: Accepted
N=int(input())
B=list(map(int,input().split()))
A=[]
for c in B:
    A.append(c)
A.append(B[-1])

for a in range(len(B)):
   
    if A[a]>B[a]:
        A[a]=B[a]
    elif A[a+1]>B[a]:
        A[a+1]=B[a]

print(sum(A))
# Judge status: Accepted
N, X, T = map(int, input().split())

import math
print(math.ceil(N / X) * T)
# Judge status: Accepted
n,T = map(int, input().split())
l = []
for i in range(n):
  c,t = map(int, input().split())
  if t <= T:
    l.append(c)
if l != []:
  print(min(l))
else:
  print("TLE")