Harryxun/stf_run huggingface dataset:
import sys

def double_factorial(args):
    for n in args:
        if n % 2 == 0 or n < 1:
            error = 'Must enter an odd number greater than or equal to one.'
            raise ValueError(error)

    max_arg = max(args)
    total = 1
    results = []
    for arg in args:
        for i in [x for x in range(1, max_arg + 1) if x % 2 != 0]:
            if i <= arg:
                total *= i
        results.append(total)
        total = 1
    return results


if __name__ == '__main__':
    if len(sys.argv) > 1:
        if sys.argv[1] == '-n':
            arg = int(sys.argv[2])
            args = []
            for i in range(1, arg + 1):
                args.append(2 * i - 1)
            results = double_factorial(args)
        else:
            args = [int(x) for x in sys.argv[1:]]
            results = double_factorial(args)
        for result in results:
            print result
    else:
        Exception('At least one integer is expected.')


### FIXED CODE ###

# v=[]
# num=251
# for i in range(num):
#     if i==0 or i==1:
#         v.append(1)
#     else:
#         v.append(i*v[i-2])
        
# for i in range(0,num,2):
#     print(i,v[i],end=' ')
#     print()

n=int(input())
if n%2!=0:
    print(0)
else:
    ans=n//10
    n=n//10
    i=1
    while(1):
        ans+=n//(5**i)
        if n//(5**i)==0:
            break
        i+=1
        
        
    print(ans)
N, M = map(int, input().split())
xyz = [list(map(int, input().split())) for _ in range(N)]

dp = [[[0, 0, 0] for _ in range(M + 1)] for _ in range(N + 1)]
# for i in dp:
#     print (i)


def calc(i, j): #残りのi個からj個選ぶ
    if j == 0: #選び終わった時
        # print ('A', i, j)
        return [0, 0, 0]
    if dp[i][j] != [0, 0, 0]: #初期状態出でない時
        # print ('B', i, j)
        return dp[i][j]
    if i == j: #残りからすべて選ばないと行けない時
        tmp = calc(i - 1, j - 1)
        dp[i][j] = [tmp[0] + xyz[N - i][0], tmp[1] + xyz[N - i][1], tmp[2] + xyz[N - i][2]]
        # print ('C', i, j)
        return dp[i][j]
    if i > j: #選ぶ余地がある時
        #使わない時
        dp[i][j] = calc(i - 1, j)
        #使う時
        tmp = calc(i - 1, j - 1)
        tmp = [tmp[0] + xyz[N - i][0], tmp[1] + xyz[N - i][1], tmp[2] + xyz[N - i][2]]
        if (abs(dp[i][j][0]) + abs(dp[i][j][1]) + abs(dp[i][j][2])) < (abs(tmp[0]) + abs(tmp[1]) + abs(tmp[2])): #使わない方が良い時
            dp[i][j] = tmp
        # print ('D',i, j)
        return dp[i][j]

ans = calc(N, M)
# print (dp)
# print (ans)
print (abs(ans[0]) + abs(ans[1]) + abs(ans[2]))

### FIXED CODE ###

N, M = map(int, input().split())
xyz = [list(map(int, input().split())) for _ in range(N)]

ans = 0
for i in range(2 ** 3):
    lst = [0] * N
    for j in range(3):
        if (i >> j) & 1:
            for k in range(N):
                lst[k] += xyz[k][j]
        else:
            for k in range(N):
                lst[k] -= xyz[k][j]
    lst.sort(reverse = True)
    ans = max(ans, sum(lst[:M]))

print (ans)
import math

def main():
    H = int(input())
    if H == 1:
        print(1)
    else:
        count = int(math.log(H, 2))
        ans = 0
        for i in range(count+1):
            ans += 2 ** (i)
            print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###


def main():
    H, A = map(int, input().split())
    count = 0
    while True:
        H -= A
        count += 1
        if H <= 0:
            break

    print(count)





if __name__ == "__main__":
    main()
N = input()
d = [input() for i in range(N)]
print(len(set(d)))

### FIXED CODE ###

N = input()
d = [input() for i in range(int(N))]
print(len(set(d)))
n,m=map(int,input().split())
s=m*1900+(n-m)*100
print(sec*2**m)

### FIXED CODE ###

N, M = map(int, input().split())

sec = M * 1900 + (N - M) * 100
print(sec * 2 ** M)
N,M=map(int, input().split())

L=dict()

for i in range(M):
  (x,y,z)=map(int, input().split())
  if x not in L:
    L[x] = [y]
  else:
    L[x].append(y)
  if y not in L:
    L[y] = [x]
  else:
    L[y].append(x)

#print(L)
S=set()
def dfs(a):
  if a in S: return
  S.add(a)
  if a in L: 
    for b in L[a]:
      dfs(b)

cnt = 0
for i in range(1, N+1):
  if i not in S:
    cnt += 1
    dfs(i)
print(cnt)

### FIXED CODE ###

import sys
mod = 10**9+7
sys.setrecursionlimit(mod)
N,M=map(int, input().split())

adj={i: set() for i in range(1,N+1)}
for i in range(M):
  x,y,z=map(int, input().split())
  adj[x].add(y)
  adj[y].add(x)
V=set()
def dfs(v):
  if v not in V:
    V.add(v)
    for u in adj[v]: dfs(u)
cnt=0
for i in range(1,N+1):
  if i not in V:
    cnt += 1
    dfs(i)
print(cnt)
def main():
    K,X = list(map(int,input().split()))
    if(500*k > X):
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()


### FIXED CODE ###

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

    price = 500 * K
    if(price >= X):
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()
a=input()
sumInput=0
for num in a:
  sumInput=sumInput+num
print sumInput

### FIXED CODE ###

a=input().split(" ")
sumInput=0
for num in a:
  sumInput=sumInput+int(num)
if sumInput>21:
	print("bust")
else:
  	print("win")
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

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

B_C = B // C
B_D = B // D
B_C_D = B // lcm(C, D)

A_C = (A - 1) // C
A_D = (A - 1) // D
A_C_D = (A - 1) // lcm(C, D)

B_div = B_C + B_D - B_C_D
A_div = A_C + A_D - A_C_D



print(B - A + 1 - (B_div - A_div))


### FIXED CODE ###

import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

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

B_C = B // C
B_D = B // D
B_C_D = B // lcm(C, D)

A_C = (A - 1) // C
A_D = (A - 1) // D
A_C_D = (A - 1) // lcm(C, D)

B_div = B_C + B_D - B_C_D
A_div = A_C + A_D - A_C_D



print(B - A + 1 - (B_div - A_div))
s = list(input())
n = len(s)
i = 0
cnt = 0
while i != n - 1:
    if (s[i] == '0' and s[i + 1] == '1') or (s[i] == '1' and s[i + 1] == '0'):
        s[i:i + 2] = []
        i -= 1
        cnt += 2
        n = len(s)
    else:
        i += 1

print(cnt)

### FIXED CODE ###

s = list(input())
n = len(s)
i = 0
cnt = 0
while i < n - 1:
    if n == 1:
        break
    if (s[i] == '0' and s[i + 1] == '1') or (s[i] == '1' and s[i + 1] == '0'):
        s[i:i + 2] = []
        i = max(i - 1, 0)
        cnt += 2
        n = len(s)
    else:
        i += 1

print(cnt)
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b,c=map(int,input().split())
    if c-a-b>0 and (c-a-b)**2>4*a*b:
        print("Yes")
    else:print("No")

if __name__=='__main__':
    main()

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    k=int(input())
    lis=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
    print(lis[k-1])
if __name__=='__main__':
    main()
n = int(input())
nums = list(map(int,input().split()))
count = 0
for i in range(n):
  if i < nums[i] and (i+1) == nums[nums[i]]:
    count += 1
print(count)

### FIXED CODE ###

n = int(input())
nums = list(map(int,input().split()))
count = 0
for i in range(n):
  if i < nums[i] and (i+1) == nums[nums[i]-1]:
    count += 1
print(count)
N,K = map(int,input().split())
h = []
for _ in range(N):
    h.append(int(input()))
h = sorted(h)
tmp = 0
ans = 1000000000
if (N == K):
    ans = sum(h)
else:
    for i in range(K):
        tmp = h[K+i-1] - h[0+i]
        if(tmp < ans):
            ans = tmp
print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
h = []
for _ in range(N):
    h.append(int(input()))
h = sorted(h)
tmp = 0
ans = 10000000000
loop = N-K+1
for i in range(loop):
    tmp = h[K+i-1] - h[0+i]
    if(tmp < ans):
        ans = tmp
print(ans)
house = [[ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ "#" for i in range(20)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ "#" for i in range(20)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ "#" for i in range(20)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)]]
n = int(input())
for i in range(n):
    b,f,r,v = map(int,input().split())
    if b==1:
        house[f-1][r-1] += v
    elif b==2:
        house[f+3*b-1][r-1] += v
    elif b==3:
        house[f+3*b-2][r-1] += v
    else:
        house[f+3*b-1][r-1] += v
for i in range(len(house)):
    if (i+1)%4 ==0:
        print(''.join(str(i) for i in house[i]))
    else:
        print('',' '.join(str(i) for i in house[i]))


### FIXED CODE ###

house = [[ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ "#" for i in range(20)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ "#" for i in range(20)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ "#" for i in range(20)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)]]
n = int(input())
for i in range(n):
    b,f,r,v = map(int,input().split())
    house[f-1+(b-1)*4][r-1] += v

for i in range(len(house)):
    if (i+1)%4 ==0:
        print(''.join(str(i) for i in house[i]))
    else:
        print('',' '.join(str(i) for i in house[i]))
a, b, c = input().split()
if a == 'a' and b == 'b' and c == 'c':
  print('Yes')
else:
  print('No')

### FIXED CODE ###

l = input()
if len([x for x in set(l) if l.count(x) > 1]) > 0:
  print('No')
else:
  print('Yes')
x, n = [int(x) for x in input().split()]
ps = [int(x) for x in input().split()]

best = 100000000
ret = x

if n:
	mn = min(ps)
	mx = max(ps)
	s = set(ps)
	for i in range(mn, mx+1):
		if i not in s:
			d = abs(x-i)
			if d < best:
				best = d
				ret = i
	if ret == x:
		up = abs(mx + 1 - x)
		down = abs(mn - 1 - x)
		ret = mn-1 if down <= up else mx+1
		
if x not in s:
	ret = x

print(ret)

### FIXED CODE ###

x, n = [int(x) for x in input().split()]
ps = [int(x) for x in input().split()]

best = 100000000
ret = x

if n:
	mn = min(ps)
	mx = max(ps)
	s = set(ps)
	for i in range(mn, mx+1):
		if i not in s:
			d = abs(x-i)
			if d < best:
				best = d
				ret = i
	if ret == x:
		up = abs(mx + 1 - x)
		down = abs(mn - 1 - x)
		ret = mn-1 if down <= up else mx+1
	if x not in s:
		ret = x

print(ret)
def merge(left, right):
    merged = []
    l_i, r_i = 0, 0

    # ソート済み配列をマージするため、それぞれ左から見ていくだけで良い
    while l_i < len(left) and r_i < len(right):
        # ここで=をつけることで安定性を保っている
        if left[l_i] <= right[r_i]:
            merged.append(left[l_i])
            l_i += 1
        else:
            merged.append(right[r_i])
            r_i += 1

    # 上のwhile文のどちらかがFalseになった場合終了するため、あまりをextendする
    if l_i < len(left):
        merged.extend(left[l_i:])
    if r_i < len(right):
        merged.extend(right[r_i:])
    return merged


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()))

import numpy as np
p = np.sort(p)[-x:]
q = np.sort(q)[-y:]
r = np.sort(r)

pq = np.array(merge(p, q))
f = True
i = 1
while True:
    f = (r[-i:] >= pq[:i]).all()
    if not f:
        break
    else:
        i += 1

i -= 1
if i:
    print(np.r_[r[-i:], pq[i:]].sum())
else:
    print(pq.sum())

### FIXED CODE ###

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()))

print(sum(sorted(sorted(p)[-x:] + sorted(q)[-y:] + r)[-(x+y):]))
import copy

def main():
    def gcd(a, b):
        if b == 0:
            return a
        else:
            return gcd(b, a%b)

    def lcm(a, b):
        return int(a / gcd(a, b)) * b
    
    n, m = map(int, input().split())
    A = set([int(x) for x in input().split()])
    A_ = copy.deepcopy(A)
    a_ = A.pop()
    for a in A:
        a_lcm = lcm(a_, a)
        a_ = a_lcm
    if a_lcm / 2 > m:
        print(0)
    for i in A_:
        if a_lcm / 2 % i == 0:
            print(0)
            exit()    
    else:
        ans = int((m - (a_lcm / 2))) // a_lcm + 1
        print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import copy
# from math import gcd


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return (a // gcd(a, b)) * b
def main():
    n, m = map(int, input().split())
    A = set([int(x) for x in input().split()])
    a_lcm = 1
    for a in A:
        a_lcm = lcm(a_lcm, a)
        # mがlcmの半分よりも小さかったら0
        if (a_lcm / 2) > m:
            print(0)
            exit()
    for a in A:
        if (a_lcm / 2) % a == 0:
            print(0)
            exit()
    # # あとは定数倍の数調べて終わり
    ans = int((m - (a_lcm / 2)) // a_lcm) + 1
    print(ans)

if __name__ == '__main__':
    main()
N, M = map(int, input().split())
e = [[] for _ in range(N)]
for i in range(M):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    e[A].append(B)
    e[B].append(A)
# print(e)

def dfs(n, k):
    seen[n] = k
    # print(seen)
    for i in e[n]:
        if seen[i] != -1: continue
        dfs(i, k)

seen = [-1] * N
k = -1
for i in range(N):
    if seen[i] == -1:
        k += 1
        dfs(i, k)
# print(seen)
print(k)

### FIXED CODE ###

import queue

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

seen = [-1] * N
k = -1
for i in range(N):
    if seen[i] == -1:
        k += 1
        seen[i] = k
        que = queue.Queue()
        que.put(i)
        while not que.empty():
            v = que.get()
            for nv in e[v]:
                if seen[nv] != -1: continue
                seen[nv] = k
                que.put(nv)
# print(seen)
print(k)
n=int(input())
x=[0]*n
y=[0]*n
h=[0]*n
for i in range(n):
  x[i],y[i],h[i]=map(int, input().split())
for i in range(101):
  for j in range(101):
    alist=[0]*n
    for k in range(n):
      if h[k]>0:
        alist[k]=(h[k]+abs(x[k]-i)+abs(y[k]-j))
    if len(set(alist))==1:
      ans=True
      for k in range(n):
        if h[k]==0:
          if alist[0]>(h[k]+abs(x[k]-i)+abs(y[k]-j)):
            ans=False
      if ans:
        ansx=i
        ansy=j
        ansh=alist[0]
print(ansx,ansy,ansh)

### FIXED CODE ###

n=int(input())
alist=[list(map(int, input().split())) for i in range(n)]
alist.sort(key=lambda x:x[2],reverse=True)
for i in range(101):
  for j in range(101):
    h=abs(alist[0][0]-i)+abs(alist[0][1]-j)+alist[0][2]
    ans=True
    for k in range(n):
      if max((h-abs(alist[k][0]-i)-abs(alist[k][1]-j)),0)!=alist[k][2]:
        ans=False 
    if ans:
      ansx=i
      ansy=j
      ansh=h
print(ansx,ansy,ansh)
a,b,c,d = map(int, input().split())

if b <= c or d <= a:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

k = int(input())

ans = "ACL" * k

print(ans)
N = int(input())
S = list(input())
K = int(input())

a = S[K]

for i in range(N):
    if S[i] != a:
        S[i] = "*"

print(''.join(S))

### FIXED CODE ###

N = int(input())
S = list(input())
K = int(input())

a = S[K-1]

for i in range(N):
    if S[i] != a:
        S[i] = "*"

print(''.join(S))
N = int(raw_input())
A = [0] * N
for i in range(N):
  A[i] = [0] * N

for line in sys.stdin:
  values = line.split()
  u = int(values[0]) - 1
  k = int(values[1])
  nodes = values[2:]
  for i in range(int(k)):
    v = int(nodes[i]) - 1
    A[u][v] = 1

for i in range(N):
  print " ".join([str(x) for x in A[i]])

### FIXED CODE ###

import sys

N = int(raw_input())
A = [0] * N
for i in range(N):
  A[i] = [0] * N

for line in sys.stdin:
  values = line.split()
  u = int(values[0]) - 1
  k = int(values[1])
  nodes = values[2:]
  for i in range(int(k)):
    v = int(nodes[i]) - 1
    A[u][v] = 1

for i in range(N):
  print " ".join([str(x) for x in A[i]])
N,T = map(int,input().split())
ct = list()
for _ in range(N):
  s, t = map(int,i)nput().split
  if t <= T:
    ct.append(s, t)
#ct = [input().split() for _ in range(N)]


### FIXED CODE ###

N,T = map(int,input().split())
c = 0
for _ in range(N):
  _c, _t = map(int,input().split())
  if _t <= T:
    if c == 0:
      c = _c
    elif c != 0 and _c <= c:
      c = _c
print(c if c != 0 else "TLE")
while True:
    [a,b,c]=[x for x in input().split()]
    [a,c]=[int(a),int(c)]
    print("processing")
    if a==0 and c==0:
        break
    elif op=="+":
        print(a+c)
    elif op=="-":
        print(a-c)
    elif op=="*":
        print(a*c)
    else:
        print(a//c)

### FIXED CODE ###

while True:
    [a,b,c]=[x for x in input().split()]
    [a,c]=[int(a),int(c)]
    op=b
    if op=="?":
        break
    elif op=="+":
        print(a+c)
    elif op=="-":
        print(a-c)
    elif op=="*":
        print(a*c)
    else:
        print(a//c)
import fractions
A, B = map(int, input().split())
print(int(A * B / fractions.gcd(A, B))

### FIXED CODE ###

import fractions
A, B = map(int, input().split())
print(int(A * B / fractions.gcd(A, B)))
import sys

input = sys.stdin.readline


def main():
    n, t = map(int, input().split())
    routes = filter(
        lambda x: x[1] <= t, [list(map(int, input().split())) for _ in range(n)]
    )
    if routes:
        print(min(routes)[0])
    else:
        print("TLE")


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys

input = sys.stdin.readline


def main():
    n, t = map(int, input().split())
    routes = list(
        filter(lambda x: x[1] <= t, [list(map(int, input().split())) for _ in range(n)])
    )
    if routes:
        print(min(routes)[0])
    else:
        print("TLE")


if __name__ == "__main__":
    main()
n, m, x = map(str, input().split())
lst = [int(i) for i in input().split()]

left = 0
right = 0

for i in lst:
    if i < x:
        left += 1
    else:
        right += 1

print(min(left, right))

### FIXED CODE ###

n, m, x = map(int, input().split())
lst = [int(i) for i in input().split()]

left = 0
right = 0

for i in lst:
    if i < x:
        left += 1
    else:
        right += 1

print(min(left,right))
N = list(map(int, input()))
x = 0
for i in range(N // 2):
  if N[i] != N[-i]:
    print('No')
    x = 1
    break
if x == 0:
  print('Yes')

### FIXED CODE ###

N = list(map(int, input()))
x = 0
for i in range(len(N) // 2):
  if N[i] != N[-i-1]:
    print('No')
    x = 1
    break
if x == 0:
  print('Yes')
import math

ans = []
while True:
	try:
		n = int(raw_input())
		isPrime = [-1] * (n + 1)
		isPrime[0], isPrime[1] = False, False
		i = 2
		while i * i < n:
			for j in range(i, n+i, i):
				isPrime[j] = False
			isPrime[i] = True
			i = isPrime.index(-1)
		ans.append(isPrime.count(True) + isPrime.count(-1))
	except EOFError:
		break
for num in ans:
	print num

### FIXED CODE ###

MAX = 1000000
prime = [1] * MAX
prime[0], prime[1] = 0, 0
i = 2
while i * i < MAX:
    j = 2
    while i * j < MAX:
        prime[i * j] = 0
        j += 1
    i += 1
for k in range(1, len(prime)):
    prime[k] += prime[k-1]

while True:
    try:
        n = int(raw_input())
        print prime[n]
    except EOFError:
        break
N = int(input())
A = list(map(int,input().split()))
saidaiA =[]
oya = 1/2
flag = True
for i in range(len(A)):
    ko = oya *2
    oya = ko - A[i]
    saidaiA.append(ko)
    # print("i=",i)
    # print("ko =",ko)
    # print("oya =",oya)
    if oya < 0:
        flag = False
        break
ans = 0
# print(saidaiA)
motikosi = 0
for i in range(len(A)):
    if A[-i] + motikosi >= saidaiA[-i]:
        ans += saidaiA[-i]
        motikosi = saidaiA[-i]
    else:
        ans += A[-i] + motikosi
        motikosi = A[-i] + motikosi
if flag == True:
    print(int(ans))
else:
    print(-1)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
if N == 0:
    if A[0] == 1:
        print(1)
    else:
        print(-1)
else:
    saidaiA =[]
    oya = 1
    flag = True
    for i in range(len(A)):
        if oya >= 5*10**13:
            ko = 10**14
        else:
            ko = oya *2
        if i == 0:
            ko = 1
        oya = ko - A[i]
        saidaiA.append(ko)
        if oya < 0:
            flag = False
    ans = 0
    # print(saidaiA)
    motikosi = 0
    for i in range(len(A)):
        if A[-i] + motikosi >= saidaiA[-i]:
            ans += saidaiA[-i]
            motikosi = saidaiA[-i]
        else:
            ans += A[-i] + motikosi
            motikosi = A[-i] + motikosi
    if flag == True:
        print(ans+1)
    else:
        print(-1)
l = list(map(int, input().split))

### FIXED CODE ###

l = list(map(int, input().split()))
l.sort()
l.reverse()
sl = list(map(str, l))
print(" ".join(sl))
a, b, k = map(int, input().split())
for i in range(k)
  if a > 0:
    a -= 1 
  elif b > 0:
    b -= 1
  else:
    break
print(str(a) + " " + str(b)))

### FIXED CODE ###

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

if a > 0:
    if a > k:
        a -= k
        k = 0
    else:
        k -= a
        a = 0

if b > 0:
    if b > k:
        b -= k
    else:
        b = 0

print(str(a) + " " + str(b))
while True:
    a = 0
    data = input()
    if data == 0:
        break
    a += data
print(a)

### FIXED CODE ###

while True:
    data = input()
    if data == '0':
        break
 
    print(sum([int(i) for i in data]))
n, x = map(int, input().split())
l = list(map(int, input().split()))

count = 0
sum = 0

while sum <= x or count == n + 1:
  sum += l[count]
  count+=1
print(count)

### FIXED CODE ###

n, x = map(int, input().split())
l = list(map(int, input().split()))

count = 0
sum = 0

for i in range(len(l)):
  sum += l[i]
  if sum <= x:
    count+=1
print(count + 1)
def main():
    N = int(input())
    a = map(int, input().split())
    d = {i: 0 for i in range(100001)}

    for i in a:
        d[i-1] += 1
        d[i] += 1
        d[i+1] += 1

    print(max(d.values()))

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    N = int(input())
    a = map(int, input().split())
    d = {i: 0 for i in range(-1, 100001)}

    for i in a:
        d[i-1] += 1
        d[i] += 1
        d[i+1] += 1

    print(max(d.values()))

if __name__ == '__main__':
    main()
# -*- coding: utf-8 -*-
# 個数の入力
N = input()
# スペース区切りの色の入力
S = raw_input().split()
# 出力
if "Y" in S:
	print('Four')
else:
	print('Three')

### FIXED CODE ###

# -*- coding: utf-8 -*-
# 個数の入力
N = input()
# スペース区切りの色の入力
S = input().split()
# 出力
if "Y" in S:
	print('Four')
else:
	print('Three')
n, m = map(int, input().split())
A = [int(x) for x in input().split()]
A.sort()

BC = []
for _ in range(m):
    b, c = map(int, input().split())
    BC.append([b, c])

BC.sort(key=lambda x : x[1], reverse=True)
D = []
i = 0
count = 0
while (len(D) < n) and (len(BC) > i) :
    D.append(BC[i][1])
    count += 1
    if count == BC[i][0]:
        count = 0
        i += 1
        
j = 0
while A[j] <= D[j]:
    A[j] = D[j]
    j += 1
    
print(sum(A))

### FIXED CODE ###

n, m = map(int, input().split())
A = [int(x) for x in input().split()]
A.sort()

BC = []
for _ in range(m):
    b, c = map(int, input().split())
    BC.append([b, c])

BC.sort(key=lambda x : x[1], reverse=True)
D = []
i = 0
count = 0
while (len(D) < n) and (len(BC) > i) :
    D.append(BC[i][1])
    count += 1
    if count == BC[i][0]:
        count = 0
        i += 1
        
j = 0
while (len(D) > j) and (A[j] <= D[j]) :
    A[j] = D[j]
    j += 1
    
print(sum(A))
N, K = map(int, input(),split())
h = list(map(int, input().split()))
ans = 0
for i in h:
    if i>K:
        ans +=1
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
h = list(map(int, input().split()))
ans = 0
for i in h:
    if i >= K:
        ans +=1
print(ans)
import math
import sys


def dudge_answer(a, b):
    ave = (a+b)/2
    return math.ceil(ave)


print(dudge_answer(a, b))


### FIXED CODE ###

a, b = map(int, input().split())
print((a + b + 1) // 2)
a, b = list(map(int, input().split()))

c = 0

if b == 1:
    c = 0
elif b / a == 1:
    c = b // a
else:
    c = b // a + 1

print(c)

### FIXED CODE ###

s = input()
t = input()
count = 0

for i in range(len(s)):
    if s[i] == t[i]:
        count = count + 1

print(count)