Harryxun/stf_run huggingface dataset:
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

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

x = 0
for i in range(m):
    x += b[i]
    b[i] = x

x = 0
for i in range(n):
    x = a[i]
    if x > k:
        x = a[i-1]
        ans = i
        j = i-2
        break
    if i + 1 == n:
        ans = n
        j = i-1

y = 0
for i in range(m):
    y = b[i]
    if x + y > k:
        while x + y > k and j >= 0:
            x = b[j]
            j -= 1
    if x + y <= k:
        ans = max(ans,i+j+2)

print(ans)

### FIXED CODE ###

n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = [0]*(n+1)
d = [0]*(m+1)
for i in range(n):
    c[i+1] = a[i]+c[i]
for i in range(m):
    d[i+1] = b[i]+d[i]
for i in range(m+1)[::-1]:
    if d[i] <= k:
        x = i
        break
ans = x
for i in range(1,n+1):
    while c[i] + d[x] > k:
        if x >= 1:
            x -= 1
        else:
            break
    if c[i] + d[x] <= k:
        ans = max(ans,i+x)
print(ans)
x = raw_input ()
print x ** 3

### FIXED CODE ###

x = input()
print x ** 3
n = int(input())
c = input()
rl = [ i for i,_ in enumerate(c) if _ == 'R' ]

cnt = 0
loc = 0
rid = -1
while True:
	if c[loc] == 'W':
		rloc = rl[rid]
		rid -= 1
		if rloc < loc:
			break
		else:
			cnt += 1
	loc += 1
	if loc == n:
		break
	#print(c,cnt)
print(cnt)

### FIXED CODE ###

n = int(input())
c = input()
rl = [ i for i,_ in enumerate(c) if _ == 'R' ]

cnt = 0
loc = 0
rid = -1
while True:
	try:
		if c[loc] == 'W':
			rloc = rl[rid]
			rid -= 1
			if rloc < loc:
				break
			else:
				cnt += 1
		loc += 1
		if loc == n:
			break
		#print(c,cnt)
	except:
		break
print(cnt)
N,K=map(int,input().split())
A=input().split()
A=[int(a) for a in A]
S=[]
a=1
number=0
for _ in range(N+1):
    b=A[a-1]
    if b in S:
        c=S.index(b)
        break
    number+=1
    S.append(b)
    a=b
T=S[c:number]
if K<=N:
    print(S[K-1])
else:
    z=K-c-1
    y=z%(number-c)
    print(T[y])
    

### FIXED CODE ###

N, K = map(int, input().split())
A = input().split()
A = [int(a) for a in A]
S = [1]
a = 1
number = 0
numbers=[-1 for _ in range(N)]
for _ in range(N + 1):
    b = A[a - 1]
    if numbers[b-1] != -1:
      c=numbers[b-1]
      break
    numbers[b-1]=number
    number += 1
    S.append(b)
    a = b
T = S[c+1:number+1]
if K <= number:
  print(S[K ])
else:
  z = K - c-1
  y = z % (number - c)
  print(T[y])
import time
     
    start_time = time.time()
     
    #input
    D = int(input())
    c_list = list(map(int, input().split()))
     
    s_grid = []
    for i in range(D):
        array = list(map(int, input().strip().split(' ')))
        s_grid.append(array)
     
    t_list = [1 for i in range(D)] #task_list
     
    def calculate_score(t_list,score_list,last_grid,change_query_number):
        score_list = score_list[:change_query_number]
        last_grid = last_grid[:change_query_number]
     
        if len(score_list) > 1:
            score = score_list[change_query_number-1]
            last_list = last_grid[change_query_number-1]
        else:
            score = 0
            last_list = [0 for i in range(26)]
     
        for d in range(change_query_number,D):
            score += s_grid[d][t_list[d]]
            last_list = [n+1 for n in last_list]
            last_list[t_list[d]] = 0
            for i in range(26):
                score -= c_list[i]*last_list[i]
            score_list.append(score)
            last_grid.append(last_list)
        return score_list, last_grid
     
    #first cal.
    previous_s, previous_l = calculate_score(t_list,[],[[0 for i in range(26)]],0)
    score = previous_s[-1]
     
    for k in range(1, D):
        X = -1  # k-日目に変える番号を探す
        t_list_loop = t_list
        for i in range(26):  # 26通り試す
            t_list_loop[k] = i
            score_list_k, last_grid_k = calculate_score(t_list_loop, previous_s, previous_l, k)
            if score_list_k[-1] > score:
                X = i
                score = score_list_k[-1]
                score_list_t = score_list_k
                last_grid_t = last_grid_k
     
        if X != -1:
            t_list[k] = X
            previous_s = score_list_t
            previous_l = last_grid_t
     
        # print(k,X,score)
     
        if time.time() - start_time > 1.99:
            break
     
    #final result
    for j in range(len(t_list)):
        print(int(t_list[j]) + 1)

### FIXED CODE ###

t_list = [i % 26 for i in range(365)]
for i in range(365):
	print(t_list[i]+1)
N, K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
mod = 10**9+7
B = A*2
c = 0
for i in range(len(B)):
  t = B[i]
  for j in range(1,len(B[i:])):
    if t > B[i+j]:
      c += 1
      #print(t,B[i+j])
#print(c)
s = sum(range(K))
print((c%mod*s%mod)%mod)

### FIXED CODE ###

M, D = [int(x) for x in input().split()]
dates = list(range(22,D+1))
c = 0
 
for i in range(len(dates)):
  d1 = int(str(dates[i])[-1])
  d2 = int(str(dates[i])[-2])
  if d1*d2 <= M and d1 > 1 and d2 > 1:
    #print(d2,d1)
    c += 1
print(c)
r=float(input())
x=math.pi
print("{:.7f}".format(r*r*x),"{:.7f}".format(2*r*x))


### FIXED CODE ###

from math import pi

r=float(input())
print("{:.7f}".format(pi*r*r),"{:.7f}".format(2*r*pi))
from fractions import gcd
from functools import reduce

N,X=map(int,input().split())
ls=[]

for _ in range(N):
    ls.append(abs(int(input())-X))

print(reduce(gcd,ls))


### FIXED CODE ###

from fractions import gcd
from functools import reduce

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

def int_X(x):
    return abs(int(x)-X)

ls=list(map(int_X,input().split()))

print(reduce(gcd,ls))
sss = input()
a = int(sss/100)
b = int((sss-100*a)/10)
c = int((sss-100*a-10*b))
print(a+b+c)

### FIXED CODE ###

sss = int(input())
a = int(sss/100)
b = int((sss-100*a)/10)
c = int((sss-100*a-10*b))
print(a+b+c)
S = input()
S = [int(i) for i in list(S)]

a = []
c = []
b = True
for i in range(len(S)):
    if b:
        a.append(1)
        c.append(0)
        b=False
    else:
        a.append(0)
        c.append(1)
        b=True

combined1 = [abs(x-y) for (x, y) in zip(S, a)]
combined2 = [abs(x-y) for (x, y) in zip(S, c)]

if len(S)==1:
    print(0)
else:
    print(min(sum(combined1), sum(combined2)))

### FIXED CODE ###

a,b=map(int,input().split())
print(max(2*a-1,2*b-1,a+b))
from collections import deque
def main():
    n = int(input())
    t = []
    a = []
    for i in range(n):
        in_t,in_a = map(int,input().split(' '))
        t.append(in_t)
        a.append(in_a)
    q= deque()
    q.append([t[0],a[0]])

    for i in range(1,n):
        while True:
            tmp_t,tmp_a=q.popleft()
            if tmp_t/tmp_a == t[i]/a[i]:
                q.clear()
                q.append([tmp_t,tmp_a])
                break
            elif tmp_t/tmp_a < t[i]/a[i]:
                q.append([tmp_t+1,tmp_a])
            else:
                q.append([tmp_t,tmp_a+1])
    return tmp_t+tmp_a

if __name__ == '__main__':
    print(main())

### FIXED CODE ###

def main():
    n = int(input())
    t = []
    a = []
    for i in range(n):
        in_t,in_a = map(int,input().split(' '))
        t.append(in_t)
        a.append(in_a)
    if n == 1:
        return t[0]+a[0]
    tmp_t = t[0]
    tmp_a = a[0]
    for i in range(1,n):
        if tmp_t%t[i] != 0:
            x = (tmp_t - tmp_t%t[i] + t[i])//t[i]
        else:
            x = tmp_t//t[i]

        if tmp_a%a[i] != 0:
            y = (tmp_a - tmp_a%a[i] + a[i])//a[i]
        else:
            y = tmp_a//a[i]

        if x <= y:
            x = y
        else:
            y = x
        tmp_t = t[i]*x
        tmp_a = a[i]*y
    return tmp_t+tmp_a

if __name__ == '__main__':
    print(main())
x,y = map(int,input().split())

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

a = sum(li)

if a > x:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

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

count = x//y

if x%y != 0:
    count += 1

print(count)
S=list(input())
li = ['A','T','G','C']
maxl=0
ans=0
for i in range(len(S)):
    if S[i] in li:
        leng+=1
    else:
        if leng>maxl:
            maxl=leng
        leng=0
print(maxl)

### FIXED CODE ###

S=list(input())
li = ['A','T','G','C']
ans=0
leng=0
for i in range(len(S)):
    if S[i] in li:
        leng+=1
    else:
        leng=0
    if leng>ans:
        ans=leng
print(ans)
K=int(input())
if K%2==0:
  print((K//2)**2)
else:
  print(K//2*(k//2+1))

### FIXED CODE ###

K=int(input())
if K%2==0:
  print((K//2)**2)
else:
  print(K//2*(K//2+1))
# https://cs.stackexchange.com/questions/93030/algorithm-for-checking-if-a-list-of-integers-is-pairwise-coprime

import math
n = int(input())
nums = list(map(int, input().split()))

gcd_ = nums[0]
for num in nums[1:]:
    gcd_ = math.gcd(gcd_, num)

if gcd_ >= 2:
    print('not coprime')
    exit()



def smallest_divisor(num):
    if num == 1:
        raise ValueError("error!")
    d = 2
    while d * d <= num:
        if num % d == 0:
            return d
        d += 1
    return num


prime_set = set()

for num in nums:
    soinsuu = set()
    
    warareru = num
    while True:
        divi = smallest_divisor(warareru)
        soinsuu.add(divi)
        warareru = warareru // divi
        if warareru == 1:
            break
    # print(soinsuu)
    if soinsuu & prime_set:
        print('setwise coprime')
        exit()
    else:
        prime_set |= soinsuu

print('pairwise coprime')


### FIXED CODE ###

# https://cs.stackexchange.com/questions/93030/algorithm-for-checking-if-a-list-of-integers-is-pairwise-coprime

import math
n = int(input())
nums = list(map(int, input().split()))

gcd_ = nums[0]
for num in nums[1:]:
    gcd_ = math.gcd(gcd_, num)

if gcd_ >= 2:
    print('not coprime')
    exit()



def smallest_divisor(num, start):
    if num == 1:
        raise ValueError("error!")
    d = start
    while d * d <= num:
        if num % d == 0:
            return d
        d += 1
    return num


prime_set = set()

for num in nums:
    if num == 1:
        continue

    soinsuu = set()
    
    warareru = num
    start = 2
    while True:
        divi = smallest_divisor(warareru, start)
        soinsuu.add(divi)
        warareru = warareru // divi
        start = divi
        if warareru == 1:
            break
    # print(soinsuu)
    if soinsuu & prime_set:
        print('setwise coprime')
        exit()
    else:
        prime_set |= soinsuu

print('pairwise coprime')
s = input()
if s[1]!=s[2] and s[2]!=s[3]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s = input()
if s=='AAA' or s=='BBB':
    print('No')
else:
    print('Yes')
import sys
from collections import Counter
N = int(input())
As = list(map(int,input().split()))
ct = Counter(As)
As =sorted(As)
max_dp = As[-1] +1
dp = [True] * max_dp
for key,count in ct.items():
	if count > 1:
		dp[key] = False
for A in As:
	if dp[A] == True:
		i = 2
		while A*i <= max_dp:
			dp[A*i] = False
			i+=1

ans = 0
# print(len(dp))
for A in As:
	# print(A)
	if dp[A]:
		ans+=1
print(ans)


### FIXED CODE ###

import sys
from collections import Counter
N = int(input())
As = list(map(int,input().split()))
ct = Counter(As)
As =sorted(As)
max_dp = As[-1] +1
dp = [True] * max_dp
for key,count in ct.items():
	if count > 1:
		dp[key] = False
		i = 2
		while key*i < max_dp:
			dp[key*i] = False
			i+=1
for A in As:
	if dp[A] == True:
		i = 2
		while A*i < max_dp:
			dp[A*i] = False
			i+=1

ans = 0
# print(len(dp))
for A in As:
	# print(A)
	if dp[A]:
		ans+=1
print(ans)
import numpy as np
import itertools
[n,k]=map(int,input().split())
a=np.array(list(map(int,input().split())))

c=sorted([x * y for x, y in itertools.combinations(a,2)])
print(c[k-1])


### FIXED CODE ###

a=list(map(int,input().split()))
check=0
if a[0]==a[1]:
    check+=1
if a[0]==a[2]:
    check+=1
if a[1]==a[2]:
    check+=1
if check==1:
    print('Yes')
else:
    print('No')
A = map(int,input().split())
A.remove(max(A))
print(0.5*(A[0])*(A[1]))

### FIXED CODE ###

A = list(map(int,input().split()))
print(A[0]*A[1]//2)
import sys

import numpy as np
from scipy.sparse import coo_matrix
from scipy.sparse.csgraph import dijkstra

sys.setrecursionlimit(10000)
INF = float('inf')

N, M, S, T = list(map(int, input().split()))
U = []
V = []
A = []
B = []
for _ in range(M):
    u, v, a, b = list(map(int, input().split()))
    U.append(u)
    V.append(v)
    A.append(a)
    B.append(b)

graph_yen = coo_matrix((A, (U, V)), shape=(N + 1, N + 1))
graph_snuke = coo_matrix((B, (U, V)), shape=(N + 1, N + 1))

# yen_mins[i]: S から i まで行くときの最小金額
yen_mins = dijkstra(graph_yen, indices=S, directed=False, unweighted=False)
# snuke_mins[i]: T から i まで行くときの最小金額
snuke_mins = dijkstra(graph_snuke, indices=T, directed=False, unweighted=False)

# total_mins[i]: i で両替して S から T まで行くときの最小金額
total_mins = 10 ** 15 - (yen_mins + snuke_mins)[1:]

# 後ろから累積最大値とる
for a in np.maximum.accumulate(total_mins[::-1])[::-1]:
    print(int(a))


### FIXED CODE ###

import heapq
import sys

import numpy as np

sys.setrecursionlimit(10000)
INF = float('inf')


def dijkstra(graph, start):
    """
    :param list of (list of (int, int)) graph:
    :param int start:
    :return:
    """
    dist = [INF for _ in range(len(graph))]
    dist[start] = 0
    heap = []
    heapq.heappush(heap, (0, start))

    while len(heap) > 0:
        w, v = heapq.heappop(heap)
        if w > dist[v]:
            continue
        for u, dw in graph[v]:
            if w + dw < dist[u]:
                dist[u] = w + dw
                heapq.heappush(heap, (w + dw, u))
    return dist


N, M, S, T = list(map(int, input().split()))
graph_yen = [[] for _ in range(N + 1)]
graph_snuuk = [[] for _ in range(N + 1)]
for _ in range(M):
    u, v, a, b = list(map(int, input().split()))
    graph_yen[u].append((v, a))
    graph_yen[v].append((u, a))
    graph_snuuk[u].append((v, b))
    graph_snuuk[v].append((u, b))

# yen_mins[i]: S から i まで行くときの最小金額
yen_mins = np.array(dijkstra(graph_yen, start=S))
# snuke_mins[i]: T から i まで行くときの最小金額
snuke_mins = np.array(dijkstra(graph_snuuk, start=T))

# totals[i]: i で両替して S から T まで行くときの最大金額
totals = 10 ** 15 - (yen_mins + snuke_mins)[1:]
# 後ろから累積最大値とる
for a in np.maximum.accumulate(totals[::-1])[::-1]:
    print(int(a))
#coding=UTF-8
#ぎりぎり間に合わないので少しがんばってみる
def turn_check(zikan):
    nokori_naka=zikan
    for idx in range(0,N,1):
        rem_hp=kirei_HP[idx]-around*zikan
        if rem_hp > 0:
        
            nokori_naka=nokori_naka-(rem_hp//dmgsa + (0 if rem_hp%dmgsa==0 else 1))
            if nokori_naka < 0:
                return False
        else: #以降も周辺攻撃のみで倒せる
            return True

    return True


mozir=input()
hyo=mozir.split(' ')
N=int(hyo[0])
A=int(hyo[1])
B=int(hyo[2])

HP=[]
for idx in range(0,N,1):
    HP.append(int(input()))

kirei_HP=sorted(HP,reverse=True)
kagen=kirei_HP[0]// A + 1

tansaku=kagen//2
dmgsa=A-B
while True:
    if turn_check(tansaku):
        kagen=tansaku
        tansaku=kagen//2
    else:
        if tansaku + 1 == kagen: #丁度境目を見付けたら
            break
        else:
            tansaku=(tansaku+kagen)//2

print(kagen)


### FIXED CODE ###

#coding=UTF-8
myon_chache={}
def turn_check(zikan,direct,around):
    nokori_naka=zikan
    for idx in range(0,N,1):
        rem_hp=kirei_HP[idx]-around*zikan
        if rem_hp > 0:
            if rem_hp in myon_chache:
                myon=myon_chache[rem_hp]
            else:
                myon= rem_hp//(direct-around) + (0 if rem_hp%(direct-around)==0 else 1)
                myon_chache[rem_hp]=myon
        
            nokori_naka=nokori_naka-myon
            if nokori_naka < 0:
                return False
        else: #以降も周辺攻撃のみで倒せる
            return True

    return True


mozir=input()
hyo=mozir.split(' ')
N=int(hyo[0])
A=int(hyo[1])
B=int(hyo[2])

HP=[]
for idx in range(0,N,1):
    HP.append(int(input()))

kirei_HP=sorted(HP,reverse=True)
dmg_mean= B
kagen=kirei_HP[0]// dmg_mean + 1
tansaku=kagen//2
ite=0
dame_jogen=0
while True:
    ite=ite+1
    if turn_check(tansaku,A,B):
        kagen=tansaku
        tansaku=(kagen+dame_jogen)//2
    else:
        if tansaku + 1 == kagen: #丁度境目を見付けたら
            break
        else:
            dame_jogen=tansaku
            tansaku=(tansaku+kagen)//2

#print(ite)
print(kagen)
#!/usr/bin/python3

import sys
# input = sys.stdin.readline
sys.setrecursionlimit(100000)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7

#N = int(input())
#A = [int(x) for x in input().split()]
#V = [[0] * 100 for _ in range(100)]

A, B, C = [x for x in input().split()]
print(f"{C} {A} {B}")

### FIXED CODE ###

#!/usr/bin/python3

import sys
# input = sys.stdin.readline
sys.setrecursionlimit(100000)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7

#N = int(input())
#A = [int(x) for x in input().split()]
#V = [[0] * 100 for _ in range(100)]

A, B, C = [x for x in input().split()]
print("{} {} {}".format(C,A,B))
n=input()
ans=0
for i in range(1,n+1):
  if len(str(i)) % 2 == 1:
    ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
ans = 0

for i in range(1, n + 1):
  if len(str(i)) % 2 == 1:
    ans += 1

print(ans)
a, b, c, d = map(int, inmput().split())

x = abs(a - b)
y = abs(b - c)
z = abs(c - a)

if z <= d:
  print('Yes')
elif x<= d and y <= d:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

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

x = abs(a - b)
y = abs(b - c)
z = abs(c - a)

if z <= d:
  print('Yes')
elif x<= d and y <= d:
  print('Yes')
else:
  print('No')
line = input()
num_a, num_b = [int(n) for n in line.split()][0]
print(max([num_a + num_b, num_a - num_b, num_a * num_b]))

### FIXED CODE ###

a,b = map(int,input().split())
print(max([a+b,a-b,a*b]))
x  = list[map(int,input().split())]
x = sum(x)
ans = 15-x
print(ans)

### FIXED CODE ###

x  = (list(map(int,input().split())))
x = sum(x)
ans = 15-x
print(ans)
# input
N_lst = [int(x) for x in list(input())]

if N_lst[0] == 9 or N_lst[1] == 9:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

# input
N = int(input())
K = int(input())
X = list(map(int, input().split()))

ans = 0

for i in range(N):
    if X[i] >= K - X[i]:
        ans += 2 * (K - X[i])
    else:
        ans += 2 * X[i]

print(ans)
s = input()
x,y = map(int,input().split())
count = 0
d = []
for i in range(len(s)):
    if s[i] == 'F':
        count += 1
    else:
        d.append(count)
        count = 0
if count != 0:
    d.append(count)

dx = [d[i] for i in range(len(d)) if i%2==0]
dy = [d[i] for i in range(len(d)) if i%2==1]
if len(dx) == 0:
    dx = [0]
if len(dy) == 0:
    dy = [0]
dpx = [dx[0]]
dpy = [dy[0],-dy[0]]
for i in range(len(dx)-1):
    trans = set()
    for j in range(len(dpx)):
        trans.add(dpx[j]+dx[i+1])
        trans.add(dpx[j]-dx[i+1])
    dpx = list(trans)
for i in range(len(dy)-1):
    trans = set()
    for j in range(len(dpy[1])):
        trans.add(dpy[1][j]+dy[i+1])
        trans.add(dpy[1][j]-dy[i+1])
    dpy = list(trans)
ans = (x in dpx)&(y in dpy)

if ans:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s = input()
x,y = map(int,input().split())
count = 0
d = []
s = s.split('T')
d = [len(x) for x in s]

if len(d) == 0:
    d.append(0)
if len(d) == 1:
    d.append(0)
dpx = [d[0]]
dpy = [d[1],-d[1]]
for i in range(2,len(d)):
    di = d[i]
    trans = set()
    if i%2==0:
        for xj in dpx:
            trans.add(xj+di)
            trans.add(xj-di)
        dpx = list(trans)
    else:
        for yj in dpy:
            trans.add(yj+di)
            trans.add(yj-di)
        dpy = list(trans)
ans = (x in dpx)&(y in dpy)

if ans:
    print('Yes')
else:
    print('No')
def gcd(a, b):
    c = a%b
    while(c != 0):
        a = b
        b = c
        c = a%b
    return b

def answer(s, t):
    a = len(s)
    b = len(t)
    if a[0] != b[0]:
        return -1
    if a < b:
        temp = a
        a = b
        b = temp
    gcdAB = gcd(a, b)
    if gcdAB == 1:
        return a*b
    else:
        stack = 0
        sl = (gcdAB * (a//gcdAB) * (b//gcdAB))
        aJump = sl//a
        bJump = sl//b
        for i in range(b):
            if stack%aJump == 0:
                if s[stack//aJump] != t[i]:
                    return -1
            stack = bJump*(i+1)
        return sl
                

sl, tl = map(int, input().split())
s = input()
t = input()
print(answer(s, t))


### FIXED CODE ###

def gcd(a, b):
    c = a%b
    while(c != 0):
        a = b
        b = c
        c = a%b
    return b

def answer(s, t):
    a = len(s)
    b = len(t)
    if s[0] != t[0]:
        return -1
    if a < b:
        temp = a
        a = b
        b = temp
        temp = s
        s = t
        t = temp
    gcdAB = gcd(a, b)
    if gcdAB == 1:
        return a*b
    else:
        stack = 0
        sl = (gcdAB * (a//gcdAB) * (b//gcdAB))
        aJump = sl//a
        bJump = sl//b
        for i in range(b):
            if stack%aJump == 0:
                if s[stack//aJump] != t[i]:
                    return -1
            stack = bJump*(i+1)
        return sl
                

sl, tl = map(int, input().split())
s = input()
t = input()
print(answer(s, t))
import numpy as np

def main():
    """
    N, M, C = np.array([int(x) for x in input().split(' ')])
    b_arr = np.array([int(x) for x in input().split(' ')])
    a_mat = np.zeros((N,M))
    """
    N ,M, C = map(int, input().split())
    b_arr = np.array(list(map(int, input().split())))
    a_mat = np.array( [ list(map(int, input().split())) for i in range(N) ] )
    
   # for i in range(N):
    #    a_mat[i] = np.array(list(map(int, input().split())))
        #a_mat[i] = np.array([int(x) for x in input().split(' ')])

        #print ( len(list( np.where( a_mat.dot(b_arr)> -C ) )[0]) )
    print ( np.array(np.where(a_mat.dot(b_arr) > -C)).shape[1] )

if __name__ == '__main__':
    main()


### FIXED CODE ###

H, W = map(int, input().split())
h, w = map(int, input().split())

res = (H-h)*(W-w)

print(res)
N, M = [int(item) for item in input().split()]
S = input()
a=[]
s = S
n = N
while n > 0:
    for i in range(M, 0, -1):
        can = False
        if n>=i and s[n-i] == '0':
            a.append(i)
            s = s[:n-i+1]
            print(s)
            n -= -i
            can = True
            break
    if not can and len(s)>1:
        print(-1)
        a=[]
        break
a=a[-1::-1]
if len(a):
    print(*a)

### FIXED CODE ###

N, M = [int(item) for item in input().split()]
S = input()
a=[]
s = S
n = N
while n > 0:
    for i in range(M, 0, -1):
        can = False
        if n>=i and s[n-i] == '0':
            a.append(i)
            s = s[:n-i+1]
            n -= i
            can = True
            break
    if (not can) and len(s)>1:
        print(-1)
        a=[]
        break
a=a[-1::-1]
if len(a):
    print(*a)
N,A=map(int,input().split())
x=N/500
if x<500:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N=int(input())
A=int(input())
if N%500<=A:
  print('Yes')
else:
  print('No')