peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
S = input()
S1, S2 = S[0:2], S[2:5]
if int(S1) > 12 and (int(S2) >= 1 and int(S2) <= 12):
	print('YYMM')
elif (int(S1) >= 1 and int(S1) <=12) and int(S2) > 12:
	print('MMYY')
elif (int(S1) >= 1 and int(S1) <=12) and (int(S2) >= 1 and int(S2) <=12):
	print('AMBIGUOUS')
else:
	print('NA')
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
t = list(input())
ans = ''.join(t)

if t[0] == '?':
    t[0] = 'P'
for i in range(len(t) - 1):
    if t[i] == 'P' and t[i+1] == '?':
        #print('A')
        t[i+1] = 'D'
    elif t[i] == 'D' and t[i+1] == '?':
        #print('B')
        t[i+1] = 'P'
print(''.join(t))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
cnt = 0
for i in range(n-1):
    if a[i+1]<a[i]:
        cnt += a[i]-a[i+1]
        a[i+1] = a[i]
print(cnt)
# Judge status: Wrong Answer
N = int(input())
S = input()
char = set(list(S))

ans = 1
for c in char:
    ans *= S.count(c) + 1
ans -=1
print(ans)
# Judge status: Wrong Answer
def main():
    n, m = map(int, input().split())
    work = [[] for _ in range(10 ** 4 + 1)]
    for _ in range(n):
        a, b = map(int, input().split())
        work[b].append(a)
    for i in range(10 ** 4 + 1):
        work[i].sort(reverse=True)
    cnt = 0
    ans = 0
    for i in range(10 ** 4, -1, -1):
        for w in work[i]:
            if cnt + w <= m:
                ans += i
                cnt += 1
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n, k = [int(i) for i in input().split()]
mod = 10**9 + 7
ans = 0

for i in range(k, n + 2):
    first = i * (i - 1) / 2
    final = (n * 2 - i + 1) * i / 2
    add = final - first + 1
    ans = (ans + add) % mod

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

input = sys.stdin.buffer.readline
n, k = map(int, input().split())
A = list(map(int, input().split()))

# A.sort()


def hantei(x):
    cnt = 0
    for i in range(n):
        cnt += A[i] // x
    return cnt


ok = 10 ** 9
ng = 0

while ok - ng > 1:
    mid = (ok + ng) // 2
    if hantei(mid) <= k:
        ok = mid
    else:
        ng = mid
    # print(ok, ng)
print(ok)
# Judge status: Wrong Answer
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(26-i)
# Judge status: Accepted
from sys import exit
n=int(input())
H=list(map(int,input().split()))
H[0] -= 1
for i in range(n-1):
	if H[i]>H[i+1]:
		print("No")
		exit()
	elif H[i]!=H[i+1]:
		H[i+1] -= 1
print("Yes")
# Judge status: Accepted
N = int(input())
A,B = [],[]
total = 0
for i in range(N):
    (a,b) = map(int,input().split())
    A.append(a)
    B.append(b)
for i in range(N):
    if (A[N-i-1]+total)%B[N-i-1] == 0:
        continue
    else:
        total += B[N-i-1]-((A[N-i-1]+total)%B[N-i-1])
print(total)
# Judge status: Accepted
def answer(s: str, t: str) -> str:
    for _ in range(len(s)):
        if t == s:
            return 'Yes'
        s = s[-1] + s[:-1]
    return 'No'


def main():
    s = input()
    t = input()
    print(answer(s, t))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
s = input()
if (len(s)+1)//2 == s.count('hi'):
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
from collections import Counter
w = input()
c = Counter()
print('Yes' if all([1 for i in c.values() if not i % 2]) else 'No')
# Judge status: Accepted
n,m=map(int,input().split())
lst=[0]*(n)
for i in range(m):
    a,b=map(int,input().split())
    lst[a-1]+=1
    lst[b-1]+=1
for i in range(n):
    print(lst[i])
# Judge status: Accepted
a,b,c,d = list(map(lambda x: int(x), input().split()))
ac, bc, bd, ad = a*c, b*c, b*d, a*d

e1 = ac if ac >= bc else bc
e2 = bd if bd >= ad else ad
ans = e1 if e1 >= e2 else e2
print(ans)
# Judge status: Wrong Answer
n = input()
d =  {}

res = []
qes = []
score = []
for i in xrange(n):
    r,s = raw_input().split()
    if r not in d:
        d[r] = [(i,s)]
    else:
        d[r].append((i,s))
    if r not in res:
        qes.append(r)
    res.append(r)
    score.append(s)
qes = sorted(qes)

for j in qes:
    for k in sorted(d[j]):
        print   k[0]+1
# Judge status: Accepted
n,k=map(int,input().split())
l=list(map(int,input().split()))
for i in range(k,len(l)):
	if l[i]<=l[i-k]:
		print('No')
	else:
		print('Yes')
# Judge status: Accepted
n=0
s=list(str(input()))
t=list(str(input()))
for i in range(len(s)):
  if s[i] != t[i]:
    n+=1
print(n)
# Judge status: Accepted
from fractions import gcd

N = int(input())
A = list(map(int, input().split()))
mod = 10**9+7

x = 1
for i in range(N):
  x = (x*A[i]) // gcd(x, A[i])

ans = 0
for a in A:
  ans += x//a
  #ans %= mod
print(ans%mod)
# Judge status: Accepted
o=input()
e=input()+' '
print(''.join([i+j for i,j in zip(o,e)]))
# Judge status: Accepted
A, B = map(int, input().split())

m = -1
for n in range(100001):
    if A*100 <= 8*n < (A+1)*100 and B*100 <= 10*n < (B+1)*100:
        m = n
        break
print(m)
# Judge status: Wrong Answer
A,B,C=input().split()

if  A==B==C:
    print('No')
elif A!=B and A!=C and B!=C:
    print('No')
else:
    print('yes')
# Judge status: Wrong Answer
from collections import Counter
X= input()
S = Counter(X)
if len(S.keys()) == 3:
    if max(S.values()) - min(S.values()) >= 2:
        print("NO")
    else:
        print("YES")
if len(S.keys()) == 2:
    if max(S.values()) - min(S.values()) >= 2:
        print("NO")
    else:
        print("YES")
if len(S.keys()) == 1:
    if len(X) == 1:
        print("YES")
    else:
        print("NO")
# Judge status: Accepted
n = int(input())
P = list(map(int, input().split()))
c = 0
for i in range(n-1):
    if P[i] == i+1:
        P[i], P[i+1] = P[i+1], P[i]
        c += 1
if P[n-1] == n:
    P[n-1], P[n-2] = P[n-2], P[n-1]
    c += 1
print(c)
# Judge status: Wrong Answer
n = int(input())
a = int(input())
b = 0
while True:
    if (500*b + a) > n:
        print("NO")
        break

    if (500*b + a) - n == 0:
        print("YES")
        break

    b+=1
# Judge status: Wrong Answer
N, M = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(N)]
C = [list(map(int, input().split())) for _ in range(M)]


for a in A:
    distance = 100
    point = 0
    for i, c in enumerate(C):
        if abs(a[0] - c[0]) + abs(a[1] - c[1]) < distance:
            distance = abs(a[0] - c[0]) + abs(a[1] - c[1])
            point = i
    print(point + 1)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
pin=a[0]
cnt=1
x=[]
for i in range(1,n):
  if a[i]==pin:
    cnt+=1
  else:
    if cnt>=4:
      x+=[pin]
      x+=[pin]
    elif cnt>=2:
      x+=[pin]
    if len(x)>=2:
      break
    pin=a[i]
    
if len(x)<=1:
  print(0)
else:
  print(x[0]*x[1])
# Judge status: Accepted
from collections import defaultdict

n=int(input())
A=list(map(int,input().split()))
B=defaultdict(int)
res=0

for i in range(n):
	B[A[i]+i]+=1
	if i-A[i] in B:
		res+=B[i-A[i]]

print(res)
# Judge status: Wrong Answer
x = int(input())
num = (x - 1) // 11 * 2 + 1
if x % 11 > 6:
    num += 1
print(num)
# Judge status: Accepted
m=input()
a=int(m[0])-1+(len(m)-1)*9
b=0
for i in m:
  b+=int(i)
print(max(b,a))
# Judge status: Wrong Answer
n = int(input())
d = {}
for _ in range(n):
  s = input()
  if s not in d:
    d[s] = 0
  d[s] += 1
m  =int(input())
for _ in range(m):
  s = input()
  if s not in d:
    d[s] = 0
  d[s] -= 1
  
ans = 0
for key in d:
  ans += max(d[key], 0)
print(ans)
# Judge status: Wrong Answer
s = str(input())
num = [0 for _ in range(len(s)+1)]
for i in range(len(s)):
  if (s[i] == "<"):
    num[i+1] = num[i]+1
for i in range(len(s),1,-1):
  if (s[i-1] == ">"):
    num[i-1] = max(num[i-1],num[i]+1)
print(sum(num))
# Judge status: Wrong Answer
data1 = input()
data2 = input()

count = len(data1) -1
sw = 0
i = 0
j = len(data2)-1
while i <= count:
    if data1[i] == data2[j]:
        sw += 1
    i += 1
    j -= 1
if sw == len(data1):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b,c,d=map(int,input().split())
print("Yes" if (abs(b-a)<= d and abs(c-b)<=d) or abs(c-a)<=d  else "No")
# Judge status: Accepted
n = int(input())

all_count = 0
options = [str(i) for i in range(10)]

maeato = [[0 for i in range(10)] for j in range(10)]

for i in range(n+1):
    checking = str(i)
    maeato[int(checking[0])][int(checking[-1])]+=1
all_count = 0
for i in range(1,10):
    for j in range(1,10):
        for k in range(1,10):
            for p in range(1,10):
                if i == p and j == k:
                    all_count+=maeato[i][j]*maeato[k][p]
print(all_count)
# Judge status: Accepted
n, q = map(int, input().split())
S = input().strip()
*LR, = (map(int, input().split()) for _ in range(q))

A = [0] * n
for i in range(1, n):
    A[i] = A[i-1] + (S[i-1:i+1] == 'AC')
for l, r in LR:
    print(A[r-1]-A[l-1])
# Judge status: Wrong Answer
k, a, b = map(int, input().split())
x=k+1
y=0
if b>a:
    c=b-a
    k=k-a-1
    y=c*(k//2-1)+b+(k%2)
print(max(x,y))
# Judge status: Wrong Answer
s=(input())
k=s[2:-1]
m=k.replace('C', 'c',1)
print(k)
print(m)
if k.count('C')==1 and s[0]=='A' and m==k.lower():
    print('AC')
else:
    print('WA')
# Judge status: Accepted
N=int(input())
arr=list(map(int,input().split()))

count=0
for i in range(N):
    if arr[i]<0:
        count+=1
        arr[i]*=-1


if count%2!=0:
    print(sum(arr)-2*min(arr))
else:
    print(sum(arr))
# Judge status: Accepted
from math import factorial as f
n,m=map(int,input().split())
if abs(n-m) >= 2:
  print(0)
  quit()
if n == m:
  print(f(n)*f(m)*2%(10**9+7))
else:
  print(f(max(m,n))*f(min(m,n))%(10**9+7))
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
from math import factorial
mod=10**9+7
n,m=map(int,input().split())
if n>m:
    n,m=m,n
if n+1==m:
    n=factorial(n)%mod
    m=factorial(m)%mod
    print(n*m)
elif n==m:
    n=factorial(n)%mod
    m=factorial(m)%mod
    print(2*n*m%mod)
else:
    print(0)
# Judge status: Wrong Answer
S = input()
A = S[0]
B = S[1]
C = S[2]
D = S[3]

if A == B and C ==D and A != C:
  print("Yes")
elif A == C and B ==D and A != C:
  print("Yes")
elif A == D and B == C and A != B:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
def main():
    n = int(input())
    
    t = 0

    if t%9==0:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()
# Judge status: Accepted
n, m = map(int, input().split())
a = list(map(int, input().split()))

if sum(a) > n:
    print(-1)
else:
    print(n-sum(a))
# Judge status: Accepted
n = int(input())

lst = [2,1]
for i in range(2,n+1):
    lst.append(lst[i-1]+lst[i-2])
print(lst[n])
# Judge status: Accepted
print("ABD" if int(input())>999 else "ABC")
# Judge status: Accepted
def main():
	inputList= list(map(int, input().split()))
	score =[1,0,-1]
	ans =0
	for i in range(len(inputList)-1):
		if inputList[3] >= inputList[i]:
			inputList[3] = inputList[3] - inputList[i]
			ans = ans + inputList[i]*score[i]
		else:
			ans = ans + inputList[3]*score[i]
			return ans
	return ans
     
if __name__ == '__main__':
	print(main())
# Judge status: Wrong Answer
import sys

num = sys.stdin.readline().split(' ')
K = int(num[0])
S = int(num[1])

counter = 0
for i in range(K+1):
    for j in range(K+1):
        for k in range(S-i-j):
            if i+j+k == S:
                counter += 1
            else:
                continue

print(counter)
# Judge status: Wrong Answer
N, K = map(int, input().split(' '))
S = input()

K -= 1

print(S[:K] + S[K].lower() + S[K:])
# Judge status: Wrong Answer
a,b = map(int,input().split())
print(b if a==b else a)
# Judge status: Accepted
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
sys.setrecursionlimit(500*500)
import itertools
from collections import Counter,deque

def main():
    n, m = map(int, input().split())
    l = [list(map(int, input().split())) for _ in range(n)]

    l.sort()
    ans = 0
    for i in l:
        if m<=i[1]:
            ans += m*i[0]
            break
        else:
            ans += i[0]*i[1]
            m -= i[1]
    print(ans)

if __name__=="__main__":
    main()
# Judge status: Wrong Answer
a,b,x = map(int,input().split())

a += (x - a%x)
b -= b%x

ans = 0 if a==b else b//x - a//x + 1
print(ans)
# Judge status: Accepted
abcde = list(map(int, open(0).read().split()))

minimum = abcde[0] % 10
num = 0
for i in range(len(abcde)):
    if abcde[i] % 10 < minimum and abcde[i] % 10 != 0:
        minimum = abcde[i] % 10
        num = i

ans = 0
for i in range(len(abcde)):
    if i == num:
        ans += abcde[i]
        continue
    
    if abcde[i] % 10 != 0:
        ans += (abcde[i] // 10 + 1) * 10
    else:
        ans += abcde[i]
        
print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())
r = list(map(int, input().split()))

ri = r[-1] - r[-2]
le = r[0] + a - r[-1]

if ri < le:
    print(r[-1] - r[0])
else:
    num = 0
    for i in range(1, len(r) - 1):
        num += (r[i] - r[i-1])
    print(a - r[-1] + num)
# Judge status: Accepted
N = int(input())
t = 0
ans = "Yes"
tasks = []
for i in range(N):
  tasks.append(list(map(int, input().split())))
tasks.sort(key=lambda task: task[1])
for task in tasks:
  t += task[0]
  if task[1] < t:
    ans = "No"
    break
print(ans)
# Judge status: Wrong Answer
n, l = map(int, input().split())
taste = l
num = 1
for i in range(1, n+1):
    if abs(taste) > abs(l+i-1):
        num = i
print((n*(2*l+n-1)//2) - l - num +1)
# Judge status: Accepted
n,k=[int(x) for x in input().rstrip().split()]
S=[i for i in input()]
S[k-1]=S[k-1].lower()
ans=""
for i in S:
  ans+=i
print(ans)
# Judge status: Accepted
n,m = map(int,input().split())
a = [list(input())for i in range(n)]
b = [list(input())for i in range(m)]
count = 0
for y in range(n-m+1):
    for z in range(n-m+1):
        for p in range(m):
            if b[p] == a[y+p][z:(z+m)]:
                count +=1
            if count == m:
                print("Yes")
                exit()
        count=0
print("No")
# Judge status: Accepted
a= int(input())
b= int(input())
h= int(input())
print((a+b)*h//2)
# Judge status: Wrong Answer
x, n = list(map(int, input().split()))
p = list(map(int, input().split()))
ans = 0
dist = 100
for i in range(100):
    i+=1
    if not i in p:
        if abs(x-i)<dist:
            dist = abs(x-i)
            ans = i
print(ans)
# Judge status: Accepted
n = int(input())
A = tuple(map(int, input().split()))

d = dict()
for a in A:
    d.setdefault(a, 0)
    d[a] += 1

c = 0
for i, count in d.items():
    rem = count - i
    if rem < 0:
        c += count
    else:
        c += rem
print(c)
# Judge status: Accepted
from collections import defaultdict
def main():
    def pair(n):
        a = n % 10
        b = str(n)[0]
        return '{},{}'.format(a, b)

    N = int(input())
    freq = defaultdict(int)
    for i in range(1, N+1):
        p = pair(i)
        freq[p] += 1
    
    res = 0
    for i in range(1, N+1):
        p = pair(i)
        q = ','.join(p.split(',')[::-1])
        res += freq[q]
    print(res)

main()
# Judge status: Wrong Answer
h1, m1, h2, m2, k= map(int, input().split())

s = h1 * 60 + m1
e = h2 * 60 + m2

ans = s - e - k
print(ans)
# Judge status: Accepted
import sys
from math import ceil

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())

sys.setrecursionlimit(10 ** 9)


def main():
    N = INT()
    P = [INT() for _ in range(5)]
    print(ceil(N/min(P)) + 4)
    

if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
s = input()

L = 0  # 左かっこの数
R = 0  # 右かっこの数
cnt = 0  # 左かっこ(の数に対応した、あるべき右かっこ)の数

for i in s:
    if i == "(":
        cnt += 1
    else:
        if cnt > 0:
            cnt -= 1
        else:  # あるべき右かっこの数が０以下のとき、足りてないのは左かっこ
            L += 1
R = cnt

print("("*L + s + ")"*R)
# Judge status: Accepted
n,y = map(int,input().split())
f = False
for a in range(n+1):
    for b in range(n+1):
        c = n-(a+b)
        if 10000*a+5000*b+1000*c == y and a+b+c == n and c>= 0:
            f = True
            print(a,b,c)
    if f == True:
        break
if f == False:
    print('-1 -1 -1')
# Judge status: Accepted
from bisect import bisect_left
import math
n = int(input())
lst = []
lst.append(1)
for i in range(2, int(math.sqrt(1000)) + 1):
    for j in range(2, 10):
        if i ** j <= 1000 and i ** j not in lst:
            lst.append(i ** j)

lst.sort()
print(lst[bisect_left(lst, n) - 1] if n not in lst else lst[bisect_left(lst, n)])
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N):
    if i%2==1 and A[i]%2==1:
        ans +=1
print(ans)
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10000)

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

if y == 1:
    print(1)
    exit()

asn = 0
def dfs(x,y,n):
    
    n += 1
    ans = x*2**n
    if ans > y:
        return n
    else:
        return dfs(x,y,n)

a = dfs(x,y,1)

print(a)
# Judge status: Accepted
s = input().rstrip()
t = input().rstrip()
count = 0
min_count = 10000
for i in range(len(s) - len(t) + 1):
    s_selected = s[i:i + len(t)]
    #print(s_selected)
    count = 0
    for j in range(len(t)):
        if t[j] != s_selected[j]:
            count += 1
    #print(count)
    if count < min_count:
        min_count = count
print(min_count)
# Judge status: Accepted
#!/usr/bin/env python3

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

if a <= b:
    print(a)
else:
    print(a-1)
# Judge status: Wrong Answer
import sys
a, b, c = [int(w) for w in input().split()]

ans = 0


def is_fin(a, b, c):
    global ans
    if a == b == c:
        ans = -1
        return True
    elif a % 2 or b % 2 or c % 2:
        return True
    else:
        return False


while not is_fin(a, b, c):
    ta = (b+c)/2
    tb = (a+c)/2
    tc = (a + b) / 2
    a, b, c = ta, tb, tc
    ans += 1

print(ans)
# Judge status: Wrong Answer
r, g, b = map(int, input().split())
print('Yes' if (10 * g + b) % 4 == 0 else 'No')
# Judge status: Accepted
x, y = map(int, input().split())
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]

if x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
A = [0] * (n + 1)
for i in range(1, n + 1):
  for j in range(i, n + 1, i):
    A[j] += 1
print(sum(i * A[i] for i in range(1, n + 1)))
# Judge status: Accepted
def main():
    x, y = map(int, input().split())

    for i in range(x + 1):
        total = i * 2 + (x - i) * 4
        if total == y:
            print("Yes")
            exit()
    else:
        print("No")


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))

x = len(a)
y = len(set(a))

if x == y:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
p, q, r = map(int, input().split())
x = p + q
y = q + r
z = r + p

if x>=y and x>=z:
  print(x)
elif y>=x and y>=z:
  print(y)
else:
  print(z)
# Judge status: Accepted
N,L = map(int,input().split())
Apple = []
compare = []
for i in range(N):
  Apple.append(L + i)
tot = sum(Apple)
for i in range(N):
  a = Apple[i]  
  Apple.remove(a)
  compare.append(abs(tot - sum(Apple)))
  Apple.insert(i,a)
Apple.remove(Apple[compare.index(min(compare))])
print(sum(Apple))
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n-k):
    if a[i] >= a[i+k]:
        print('No')
    else:
        print('Yes')
# Judge status: Accepted
#!/usr/bin/env python3
# N = int(input())
# S = input()
A, B = map(int, input().split())
# A = list(map(int, input().split()))
print(max(A + B, 2 * A - 1, 2 * B -1))
# Judge status: Accepted
import math

a,b=(map(int,input().split()))
ans=(a+b)/2
print(int(math.ceil(ans)))
# Judge status: Accepted
n=int(input())
x=[int(i) for i in input().split()]

sum=0
for i in range(n):
  sum=sum+x[i]

if (sum/n)%1<=0.5:
  p=int((sum/n))
else:
  p=int((sum/n))+1
  
answer=0
for i in range(n):
  answer=answer+(x[i]-p)**2

print(answer)
# Judge status: Accepted
import re

def solve():
    S = input()
    print('AC' if re.match(r'^A[a-z]+C[a-z]+$', S) else 'WA')

if __name__ == "__main__":
    solve()
# Judge status: Accepted
k,x=map(int,input().split())
a=[i for i in range(x-k+1,x+k)]
print(*a)
# Judge status: Wrong Answer
# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

import sys
input = sys.stdin.readline

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

ans = 0
if (A * B * C) % 2 != 0:
    ans = A*B
print(ans)
# 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")


x, y = map(int, input().split())
if 4*x-y>=0 and y>=2*x and (4*x-y)%2==0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b, c = map(int, input().split())

x = b / a
if (x >= c):
   print(c)
else:
   print(int(x))
# Judge status: Wrong Answer
A, B = map(int, input().split())
a , b = 0, 0
ans = 0
n = 1

for i in range(1, 100000):
  a = A * i
  if ans != 0:
    print(ans)
    break
  for j in range(n, 100000):
    b = B * j
    if a == b:
      ans = a
    elif b < a:
      continue
    else:
      n = j
      break
# Judge status: Accepted
# E - Rotation Matching

n, m = map(int, input().split())

l, r = 1, n - (n % 2)
for i in range(m):
    if n % 2 == 0 and i == (m + 1) // 2:
        l += 1
    print(l, r)
    l, r = l + 1, r - 1
# Judge status: Accepted
# D

N = int(input())

d = [0] * (10**6 + 1) 
A = list(map(int, input().split()))

for a in A:
  d[a] += 1

ans = 0
maxa = max(A) + 1
for i in range(1,maxa):
  if d[i] == 1:
    ans += 1

  if d[i] > 0:
    # d[i]の倍数は含めない
    for j in range(i*2,maxa,i):
      d[j] = 0

print(ans)
# Judge status: Accepted
start, num_move, distance = map(int, input().split())

# move toward
desired_move = abs(start) // distance

another_move = num_move - desired_move
if another_move <= 0:
    ans_abs = abs(start) - num_move * distance
    print(ans_abs)

else:
    if another_move % 2 == 0:
        ans_abs = abs(start) - desired_move * distance
        print(ans_abs)
    else:
        ans_abs = abs(abs(start) - (desired_move+1) * distance)
        print(ans_abs)
# Judge status: Accepted
N, M = map(int, input().split())
N, M = min(N, M), max(N, M)

if N != 1 and M != 1:
  print((N-2)*(M-2))
elif N == 1 and M != 1:
  print(M-2)
else:
  print(1)
# Judge status: Accepted
s = sum(int(x) for x in input().split())
print('bust' if s >= 22 else 'win')
# Judge status: Accepted
n=int(input())
res = []
for i in range(n):
    s,p=map(str, input().split())
    res += [(s,int(p))]
res1=res
res = sorted(res, key=lambda x:(x[0],-x[1]))
for i in range(n):
    print(res1.index(res[i])+1)
# Judge status: Wrong Answer
import collections
c=collections.Counter(list(input()))
cv=list(c.values())
ans=0
for i in range(len(cv)):
    if cv[i]%2==1:
        ans+=1
print('YNeos'[ans%2==1::2])
# Judge status: Wrong Answer
n = int(input())

ans = []
a = n
while a != 0:
    b = a % (-2)
    a //= (-2)
    if b == -1:
        a += 1
        b = 1
    ans.append(b)

ans.reverse()    
print(*ans, sep='')
# Judge status: Accepted
# coding: utf-8
X, Y, A, B, C = map(int, input().split())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
R = list(map(int, input().split()))
P.sort(reverse=True)
Q.sort(reverse=True)
R.sort(reverse=False)
ans = 0
L = P[:X] + Q[:Y] + R
L.sort(reverse=True)
print(sum(L[:X+Y]))
# Judge status: Wrong Answer
n = int(input())
LR = [None] * n
for i in range(n):
    x, l = map(int, input().split())
    LR[i] = (x - l, x + l)
LR.sort(key=lambda lr: -lr[1])
count = 0
cur = LR[0][0]
for l, r in LR[1:]:
    if cur < r:
        count += 1
    else:
        cur = l
print(n - count)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  A, B, K = map(int, readline().split())
  if A>=K:
    print(A-K, B)
  else:
    print(0, max(B-K+A,0))
  
  
  
  
if __name__ == '__main__':
  main()