Harryxun/stf_run huggingface dataset:
S = str(input())
K = int(input())

if K == 1:
    print(S[0])
elif K >= 2:
    if S[0] != "1":
        print(S[0])
    elif S[0:K] == "1" * K:
        print("1")
    else:
        i = 1
        while S[i] == "1" and len(S) - 2 >= i:
            i += 1
        print(S[i])

### FIXED CODE ###

S = list(input())
K = int(input())
if K == 1:
    print(S[0])
    quit()
    
for i in range(K):
    if S[i] != '1':
        print(S[i])
        quit()

print('1')
n=int(input())
def ceil(a,b):
    ret = -(-a//b)
    if ret%2==0:
        return ret
    else:
        return ret+1

print(0)
first=input()
if first=="Vacant":
    exit()

l=0
r=n

while abs(l-r)>3:
    nxt = ceil(l+r,2)
    print("l==",l,"r==",r)
    print(nxt)
    ans=input()
    if ans=="Vacant":
        exit()
    if ans==first:
        l=nxt
    else:
        r=nxt


for i in range(l,r):
    print(i)
    ans=input()
    if ans=="Vacant":
        exit()

### FIXED CODE ###

n=int(input())
def ceil(a,b):
    ret = -(-a//b)
    if ret%2==0:
        return ret
    else:
        return ret+1

print(0)
first=input()
if first=="Vacant":
    exit()

l=0
r=n

while abs(l-r)>5:
    nxt = ceil(l+r,2)
    print(nxt)
    ans=input()
    if ans=="Vacant":
        exit()
    if ans==first:
        l=nxt
    else:
        r=nxt


for i in range(l,r):
    print(i)
    ans=input()
    if ans=="Vacant":
        exit()
N = input()
S = input().strip()
type = len(set(S))

def DP(i,s):
  # 葉チェック
  if i >= len(S):
    return 1 if len(s) > 0 else 0
  if len(s) >= type:
    return 1
  
  # S[i]を採用しない枝
  notadopt = DP(i+1, s)
  
  # S[i]を採用する枝
  if S[i] not in s:
    s += S[i]
    adopt = DP(i+1, s)
  else:
    adopt = 0

  return adopt + notadopt

print(DP(0, '')%(10**9+7))


### FIXED CODE ###

from collections import Counter
input()
S = input().strip()
c = Counter(S)
ans = 1
for k,v in c.items():
  ans *= (v+1)
print((ans-1)%(10**9+7))
n,m=map(int,input().split())
a_list=[input() for _ in range(n)]
b_list=[input() for _ in range(m)]
for i in range(n-m+1):
    for j in range(n-m+1):
        f=True
        for k in range(m):
            for l in range(m):
                if a_list[i+k][j+l]!=b_list[k][l]:
                    f=false
                    break
            if not f:
                break
        if f:
            print("Yes")
            exit()
print("No")

### FIXED CODE ###

n,m=map(int,input().split())
a_list=[input() for _ in range(n)]
b_list=[input() for _ in range(m)]
for i in range(n-m+1):
    for j in range(n-m+1):
        f=True
        for k in range(m):
            for l in range(m):
                if a_list[i+k][j+l]!=b_list[k][l]:
                    f=False
                    break
            if not f:
                break
        if f:
            print("Yes")
            exit()
print("No")
while True:	
	H,W = map(int, input().split())
	if H==0 and W==0: break
	for y in range(0,H):
		for x in range(0,W):
			print("#",end="")
	    print('\n')
    print('\n')
print('\n')


### FIXED CODE ###

while True:	
	H,W = map(int, input().split())
	if H==0 and W==0: break
	for y in range(0,H):
		for x in range(0,W):
			print("#",end="")
			
		print()
	print()
N = int(input())
n = "Three"

for i in (N):
  S = input().split()
  If S == "Y":
    n = "Four"
    break
  if S != "Y":
    continue
print(n)
    

  

### FIXED CODE ###

N = int(input())
number = "Three"
S = input().split()

for i in range(N):
  if S[i] == "Y":
    number = "Four"
    break

print(number)
n = int(input())
arr = []
for i in range(n - 1):
    arr.append([int(s) for s in input().split(" ")])

mmk = {}

childNodeNums = [0 for i in range(n)]
childNodeStatus = [-1 for i in range(n)]


def generateID(fr, to):
    if to < fr:
        fr, to = to, fr
    return fr * 100000 + to


def prepare(n, arr):
    s = [[] for i in range(n)]
    for ar in arr:
        s[ar[0] - 1].append(ar[1] - 1)
        s[ar[1] - 1].append(ar[0] - 1)
    return s


# x为记录入边的颜色
def dfs(currentNode, arr, x):
    childNodes = arr[currentNode]
    if len(childNodes) == 0:
        return

    childNodeNums[currentNode] = childNodeNums[currentNode] + len(arr[currentNode])
    childNodeStatus[currentNode] = 1

    kk = 0
    for i, childNodeIndex in enumerate(childNodes):

        if childNodeStatus[childNodeIndex] == -1:
            kk = kk + 1
            if x == kk:
                kk = kk + 1
            mmk[generateID(currentNode + 1,childNodeIndex + 1)] = kk
            dfs(childNodeIndex, arr, kk)


data = prepare(n, arr)
dfs(0, data, -1)

print(max(childNodeNums))

for ar in arr:
    a0 = ar[0]
    a1 = ar[1]
    print(mmk[generateID(a0,a1)])


### FIXED CODE ###

from sys import setrecursionlimit


def genid(a, b):
    if b < a:
        a, b = b, a
    return a * 100000 + b


def paint(currentNode, usedColor, parentNode, edges, colors):
    color = 1
    for childNode in edges[currentNode]:
        if childNode == parentNode:
            continue
        if color == usedColor:
            color += 1
        colors[genid(currentNode, childNode)] = color
        paint(childNode, color, currentNode, edges, colors)
        color += 1


setrecursionlimit(100000)

N = int(input())
ab = [list(map(int, input().split())) for _ in range(N - 1)]

edges = [[] for _ in range(N)]
for a, b in ab:
    edges[a - 1].append(b - 1)
    edges[b - 1].append(a - 1)

colors = {}
paint(0, -1, -1, edges, colors)

print(max(len(e) for e in edges))
for a, b in ab:
    print(colors[genid(a - 1, b - 1)])
y=0
for _ in range(int(input())):
    x,u=input().split()
    y+=int(x) if u=="JPY" else float(x)*380000
print(y

### FIXED CODE ###

year, month, day = map(int, input().split("/"))
if year <= 2019 and month <= 4 and day <= 30:
    print("Heisei")
else:
    print("TBD")
N,K = map(int,input().split())
 
P = [0 for i in range(N)]
for i in range(K):
  a = int(input())
  b = list(int,input().split())
  for i in range(a):
    P[b[i]-1] = 1 
m = 0   
for i in range(N):
  if P[l] == 0:
    m += 1
    
print(m)

### FIXED CODE ###

n, k = map(int, input().split())
 
m = [0]*n
 
for i in range(k):
    d = int(input())
    a = [int(x) for x in input().split()]
    for j in range(d):
        m[a[j]-1] += 1
 
print(m.count(0))
n = int input()
a = list(map(int,input().split()))

for i in range(n):
  if  a[i] % 2 == 0 and (a[i] % 3 == 0 or a[i] % 5 == 0):
    print("APPROVED")
    exit()
else:
  print("DENIDE")


### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
c = 0
for i in range(N):
    if A[i] % 2 == 0:
        if A[i] %3 != 0 :
            if A[i] %5 != 0:
                c = 1
                break
if c == 0:
    print("APPROVED")
else:
    print("DENIED")
import math
A,B,H,M = map(int, input().split())
X = H*30+M*0.5
Y = M*6
if  -180 < X - Y < 0:
  Z = Y - X
elif X - Y <= -180:
  Z = 360 -(Y - X)
elif 180 > X - Y >= 0:
  z = X - Y
else:
  z = 360-(X - Y)
ans = A*A+B*B-2*A*B*math.cos(math.radians(z))
ANS = math.sqrt(ans)

print(ANS)

### FIXED CODE ###

import math
A,B,H,M = map(int, input().split())
X = H*30+M*0.5
Y = M*6
if  -180 < X - Y < 0:
  z = Y - X
elif X - Y <= -180:
  z = 360 -(Y - X)
elif 180 > X - Y >= 0:
  z = X - Y
elif X - Y >= 180:
  z = 360-(X - Y)
ans = A*A+B*B-2*A*B*math.cos(math.radians(z))
ANS = math.sqrt(ans)

print(ANS)
a,p = input().split()
int(a)
int(p)
print((a*3+p)//2)

### FIXED CODE ###

a,p=map(int,input().split())
print((a*3+p)//2)
a,b = map(int, input().split())
print((a+b+1)//c)


### FIXED CODE ###

a,b = map(int, input().split())
print((a+b+1)//2)
A,B,K = map(int,input().split())
ans =[]
for i in range(1, min(A,B)+1):
    if A%i == 0 and B%i == 0:
        ans.append(i)
    
    if len(ans) == K:
        print(ans[len(ans)-1])
        exit(1)
    
      


### FIXED CODE ###

A,B,K = map(int,input().split())
ans =[]
for i in range(1, min(A,B)+1):
    if A%i == 0 and B%i == 0:
        ans.append(i)
    

print(ans[-K])
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)


def problem():
    N = int(input())
    A = list(map(int, input().split()))

    print(algorithm(N, A))


def algorithm(N, A):
    gcdList = [0] * N
    for i in range(N):
        copy_A = A.copy()
        copy_A.pop(i)
        gcdList[i] = gcd_list(copy_A)

    return max(gcdList)
problem()


### FIXED CODE ###

from functools import reduce
import fractions


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

def problem():
    N = int(input())
    A = list(map(int, input().split()))

    print(algorithm(N, A))


def algorithm(N, A):
    if N == 0:
        return 0
    if N == 1:
        return A[0]
    if N == 2:
        return max(A[0],A[1])

    L_i = 0
    R_i = [0] * N
    R_i[N - 1] = A[N - 1]
    R_i[N-2] = fractions.gcd(A[N-1], A[N-2])
    
    for i in range(3,N):
        R_i[N - i] = fractions.gcd(R_i[N - i + 1], A[N - i])

    maxGCD = R_i[1]
    for i in range(1, N-1):
        L_i = fractions.gcd(L_i, A[i - 1])
        tmp = fractions.gcd(L_i, R_i[i+1])
        if tmp > maxGCD:
            maxGCD = tmp

    L_i = gcd_list(A[:N-1])
    if L_i > maxGCD:
        maxGCD = L_i
    return maxGCD

problem()
w,h,x,y = map(float,input().split())
if x == w/2 and y == h/2:
     print(w*h/2,1)
else:
     print(w*h2,0)

### FIXED CODE ###

w,h,x,y = map(float,input().split())
if x == w/2 and y == h/2:
     print(w*h/2,1)
else:
     print(w*h/2,0)
a,b,c=map(int,input().split())
d=sorted([a,b,c])
print "{0} {1} {2}".format(d[0],d[1],d[2])

### FIXED CODE ###

a,b,c=map(int,input().split())
d=sorted([a,b,c])
print ("{0} {1} {2}".format(d[0],d[1],d[2]))
import collections

n,m,k = map(int,raw_input().split(' '))

friendships = [map(int, raw_input().split(' ')) for _ in range(m)]
disses = [map(int, raw_input().split(' ')) for _ in range(k)]

parent = {i:i for i in range(1, n+1)}
sizes = {i:1 for i in range(1, n+1)}

hd = collections.Counter()

adj = collections.defaultdict(set)

def f(parent, a):
	if parent[a] != a: parent[a] = f(parent, parent[a])
	return parent[a]

for a,b in friendships:
	if a != b:
		pa,pb = f(parent, a), f(parent, b)
		
		adj[a].add(b)
		adj[b].add(a)

		if pa != pb:
			parent[pb] = pa
			sizes[pa] += sizes[pb]

for c,d in disses:
	pa,pb = f(parent, c), f(parent, d)
	if (d not in adj[c]) and  (pa == pb):
		hd[c] += 1
		hd[d] += 1
"""
hd[u] = k
u has k disses in its connected component
"""

print ' '.join([str(sizes[f(parent,u)] - len(adj[u]) - hd[u] - 1)  for u in range(1, n+1)])

### FIXED CODE ###

import collections

n,m,k = map(int,raw_input().split(' '))

friendships = [map(int, raw_input().split(' ')) for _ in range(m)]
disses = [map(int, raw_input().split(' ')) for _ in range(k)]

parent = {i:i for i in range(0, n+1)}
sizes = {i:1 for i in range(0, n+1)}

hd = collections.Counter()

adj = collections.defaultdict(set)

def f(parent, u):
	if parent[u] != u: 
		parent[u] = f(parent, parent[u])
	return parent[u]

for a,b in friendships:
	if a == b: continue

	pa,pb = f(parent, a), f(parent, b)
	
	adj[a].add(b)
	adj[b].add(a)

	if pa != pb:
		if sizes[pa] >= sizes[pb]:
			parent[pb] = pa
			sizes[pa] += sizes[pb]
		else:
			parent[pa] = pb
			sizes[pb] += sizes[pa]

for c,d in disses:
	pc,pd = f(parent, c), f(parent, d)
	if (pc == pd):
		hd[c] += 1
		hd[d] += 1
"""
hd[u] = k
u has k disses in its connected component
"""

print ' '.join([str(sizes[f(parent,u)] - len(adj[u]) - hd[u] - 1)  for u in range(1, n+1)])
# -*- coding: utf-8 -*-


def main():
    n, m, k = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    a = A[0]
    A2 = [a]
    b = B[0]
    B2 = [b]
    for i in range(1, n):
        a += A[i]
        A2.append(a)

    for i in range(1, m):
        b += B[i]
        B2.append(b)
    max = -2
    for ia, aa in enumerate(A2):
        for ib, bb in enumerate(B2):
            if aa + bb > k:
                break
            if ia + ib > max:

                max = ia + ib
    print(max + 2)


def answer():
    N, M, K = map(int, input().split())


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

    a, b = [0], [0]
    for i in range(N):
        a.append(a[i] + A[i])
    for i in range(M):
        b.append(b[i] + B[i])

    ans, j = 0, M
    for i in range(N + 1):
        if a[i] > K:
            break
        while b[j] > K - a[i]:
            j -= 1
        ans = max(ans, i + j)
    print(ans)
if __name__ == '__main__':
    answer()

### FIXED CODE ###

def main():
    a = int(input())
    print(a+a*a+a*a*a)
if __name__ == '__main__':
    main()
w=input()

dict={}
for i in w:
  dict[i]+=1
flag=True
for j in range(len(dict)):
  if dict[j]%2==1:
    flag=False
if flag:
  print("Yes")
else:
  print("No")
  

### FIXED CODE ###

w=input()

dict={}
alh="abcdefghijklmnopqrstuvwxyz"
for i in alh:
  dict[i]=0
for i in w:
  dict[i]+=1
flag=True
for i in alh:
  if dict[i]%2==1:
    flag=False
if flag:
  print("Yes")
else:
  print("No")
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと


def a_int(): return int(read())


def ints(): return list(map(int, read().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter, xor, add
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
from functools import reduce
from math import gcd


def lcm(a, b):
    # 最小公倍数
    g = gcd(a, b)
    return a // g * b


# https://atcoder.jp/contests/diverta2019-2/tasks/diverta2019_2_b
N = a_int()
XY = read_tuple(N)
# q,pは何通りありえる？N**2//2通りぐらい
# p,qを決定したらあとは直線に乗っているか確かめれば良い
# 点に当たるたびにO(N)かけて調べれば良い
# 以下のO(n**4)のプログラムが可能
# for q,p全通り
#     while ある点を選択
#        その点の+p+qを見てボールを消す
#     コストをmin
# と思ったけど、ただ単純にp,qで拾えるボールの個数を数えればいいかも

PQcandi = []
for po1, po2 in combinations(XY, r=2):
    dx = po1[0] - po2[0]
    dy = po1[1] - po2[1]
    if dx < 0:
        dx *= -1
        dy *= -1
    elif dx == 0:
        dy = abs(dy)

    PQcandi.append((dx, dy))

print(N - max(Counter(PQcandi).values()))


# def del_ball(p, q, XYtmp):
#     ret = []
#     # x軸にソートしてあるので左から拾っていく
#     x, y = XYtmp[0]
#     for xxyy in XYtmp[1:]:
#         if xxyy == (x + p, y + q):
#             x += p
#             y += q
#         else:
#             ret.append(xxyy)

#     return ret


# from copy import deepcopy
# ans = INF
# for p, q in PQcandi:
#     XYtmp = deepcopy(XY)
#     anstmp = 0
#     while XYtmp:
#         anstmp += 1
#         XYtmp = del_ball(p, q, XYtmp)
#     # print(p, q, anstmp)
#     ans = min(ans, anstmp)
# print(ans)


### FIXED CODE ###

# https://atcoder.jp/contests/diverta2019-2/tasks/diverta2019_2_b


from itertools import combinations
from collections import defaultdict

N = int(input())
points = [tuple(map(int, input().split())) for _ in range(N)]

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

# points.sort()  # 先にソートしておくと大小関係の処理が楽

cnts = defaultdict(lambda: 0)
for pa, pb in combinations(points, 2):
    dx = pa[0] - pb[0]
    dy = pa[1] - pb[1]
    if dx < 0:  # 事前にソートしておくとココらへんの処理がいらなくなるよ
        dx *= -1
        dy *= -1
    if dx == 0:
        dy = max(dy, -dy)
    if dy == 0:
        dx = max(dx, -dx)
    cnts[(dx, dy)] += 1

print(N - max(cnts.values()))
from bisect import bisect_left, insort_left
from collections import deque

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()
q.sort()
r.sort()

p = deque(p[a-x:])
q = deque(q[b-y:])
ans = sum(p) + sum(q)

for i in range(c):
	if p[0] < r[i] and q[0] < r[i]:
		if p[0] < q[0]:
			ans -= p.popleft()
			ans += r[i]
			insort_left(p,r[i])
		else:
			ans -= q.popleft()
			ans += r[i]
			insort_left(q,r[i])
	elif p[0] < r[i] and q[0] >= r[i]:
		ans -= p.popleft()
		ans += r[i]
		insort_left(p,r[i])
	elif p[0] >= r[i] and q[0] < r[i]:
		ans -= q.popleft()
		ans += r[i]
		insort_left(q,r[i])

print(ans)


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

p.sort()
q.sort()
r.sort(reverse=True)

p = p[a-x:]
q = q[b-y:]

p.extend(q)
p.sort()

ans = sum(p)
count = 0
for i in range(c):
	if p[i] < r[i]:
		ans += r[i] - p[i]
	else:
		break
print(ans)
def dfs(i, f):
    if i == len(s) - 1:
        return sum(list(map(int, f.split("+")))) 
    return dfs(i + 1, f + s[i + 1]) + \ 
    dfs(i + 1, f + "+" + s[i + 1])

s = input()
print(dfs(0, s[0]))

### FIXED CODE ###

def dfs(i, f):
    if i == len(s) - 1:
        return sum(list(map(int, f.split("+")))) 
    return dfs(i + 1, f + s[i + 1]) + \
           dfs(i + 1, f + "+" + s[i + 1])
 
s = input()
print(dfs(0, s[0]))
import math
n,m = map(int,input().split())
l = list(map(int,input().split()))
lm = 1
lm_harf = 1
for i in l:
    lm = lm*i//math.gcd(lm,i)
    lm_harf = lm_harf*(i//2)//math.gcd(lm_harf,(i//2))
print(m//lm_harf-m//lm)

### FIXED CODE ###

def culuc(a):
    cnt = 0
    while a%2==0:
        a//=2
        cnt+=1
    return cnt
def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)
def lcm(a,b):
    return a*b//gcd(a,b)
n,m = map(int,input().split())
a = list(map(int,input().split()))
cnt = culuc(a[0])
for i in a:
    if culuc(i)!=cnt:
        print(0)
        exit()
res = a[0]//2
for i in a:
    res = lcm(res,i//2)
    if res>m:
        print(0)
        exit()
print((m//res+1)//2)
n = int(input())
ans = 0

for i in range(1,n+1):
  if i**2 <= n:
    ans = i**2

print(ans)


### FIXED CODE ###

c1 = input()
c2 = input()

if c1[0] == c2[2] and c1[1] == c2[1] and c1[2] == c2[0]:
  print('YES')
else:
  print('NO')
a=[]
while True:
 n=input()
 if n=='0 ? 0':break
 a.append(n)
for s in a:
 t=s.split()
 if t[1]=='/':
  print(int(t[0])//int(t[2]))
 else:
  b=eval(''.join(t))
  print(b)

### FIXED CODE ###

while 1:
 a=input()
 if'?'in a:break
 print(int(eval(a)))
import math
a, b = map(int, input().split()) 
print(a*b//math.gcd(a,b))

### FIXED CODE ###

import fractions

a, b = map(int, input().split()) 
print(a*b//fractions.gcd(a,b))
N = int(input())

flag = False
for i in range(0,30):
  for j in range(0,30):
  	if i * 4 + j * 7 == N:
      flag = True

if flag == True:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N = int(input())

flag = False
for i in range(0,30):
  for j in range(0,30):
    if i * 4 + j * 7 == N:
      flag = True

if flag == True:
  print('Yes')
else:
  print('No')
#D
s = input()
count = 0
# print(len(s))
for left in range(len(s) - 3):
    for right in range(left + 3, len(s)):
        print(left + 1, right + 1)
        if int(float(s[left:right + 1])) % 2019 == 0:
            print(s[left:right])
            count += 1
print(count)

### FIXED CODE ###

s = input()
ans = 0
a = [0] * 2019
a[0] = 1
k = 0
mod = 1
for i in range(len(s) - 1, -1, -1):
    k = (k + int(s[i]) * mod) % 2019
    mod = (mod * 10) % 2019
    a[k] += 1
for i in a:
    ans += i * (i - 1) * 0.5
print(int(ans))
import functools
import math
def lcm(a, b):
    return a * b // math.gcd(a, b)
N,M=map(int,input().split())
A=list(map(int,input().split()))
LCM=functools.reduce(lcm,A)
HLCM=LCM//2
Y=M//HLCM
if Y%2==0:
    print(Y//2)
else:
    print((Y+1)//2)


### FIXED CODE ###

import functools
import fractions

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

# xが2で何回割れるか
def div2count(x):
    count=0
    while x%2==0:
        x=x//2
        count+=1
    return count

N,M=map(int,input().split())
A=list(map(int,input().split()))
if len(set(map(div2count,A)))!=1:
    print(0)
    exit()
LCM=functools.reduce(lcm,A)
HLCM=LCM//2
Y=M//HLCM
if Y%2==0:
    print(Y//2)
else:
    print((Y+1)//2)
N,M=input().split()

Cor = N-M
if Cor == N:
    print("yes")
else:
    print("no")

### FIXED CODE ###

N, M = input().split()

Cor = int(N)-int(M)
if Cor == 0:
    print("Yes")
else:
    print("No")
l = []
ans = []
a, b, k = list(map(int, input().split()))
l.append(a)
l.append(b)
i = 1

print('l:',l)


for i in range(1, max(l)):
    if (a % i) == 0 and (b % i) == 0:
       ans.append(i) 
    
print('ans:',ans)
print('k:',k)

if len(ans) == 0:
    print(1)
else:
    print('ans[k-1]',ans[k-1])


### FIXED CODE ###

l = []
ans = []
a, b, k = list(map(int, input().split()))
l.append(a)
l.append(b)
i = 1

for i in range(1, min(l) + 1):
    if (a % i) == 0 and (b % i) == 0:
       ans.append(i) 

if len(ans) == 0:
    print(1)
else:
    print(ans[-k])
import sys
sys.setrecursionlimit(10**6)
n,q = map(int,input().split())
a=[[] for i in range(n)]
p=[]*n
l=[0]*n

def dfs(parent,current):
    for i in a[current-1]:
        if i != parent:
            l[i-1] += l[current-1]
            dfs(current,i)


for i in range(n-1):
    t1,t2 = map(int,input().split())
    a[t1-1].append(t2)
    a[t2-1].append(t1)
    
for i in range(q):
    t1,t2 = map(int,input().split())
    l[t1-1]+=t2
dfs(-1,1)

print(" ".join(map(str,l)))

### FIXED CODE ###

n = int(input())
v = list(map(int,input().split()))

v = sorted(v)
# print(v)
def dfs (l):
    if len(l)==1:
         return l[0]
    num = (l[0]+l[1])/2.0
    l = l[2:]
    # print(l)
    l.append(num)
    # print(l)
    l = sorted(l)
    return dfs(l)



print(dfs(v))
import math

N, K = map(int, input().split())
K = min(41, K)
A = list(map(int, input().split()))
A.insert(0, 0)
B = [0] * (N+1)
ans = [N] * N

def operation():
  global A, B, N
  for i in range(1, N+1):
    left = max(1, math.ceil(i - A[i] - 0.5))
    right = min(N, math.floor(i + A[i] + 0.5))
    B[left] += 1
    if right+1 <= N:
      B[right+1] -= 1
  for i in range(1, N+1):
    B[i] += B[i-1]


operation()

#print(A)
#print(B)

for _ in range(K):
  A = B
  B = [0] * (N+1)
  operation()

print(*A[1:])



### FIXED CODE ###

S = input()

print(S[:3])
N = map(int, input())
message = 'No'
for i in range(1,10):
  if N % i == 0 and N/i < 10 :
    message = 'Yes'
    break
print(message)
  
  

### FIXED CODE ###

N = int(input())
message = 'No'
for i in range(1,10):
  if N%i==0 and N/i<10 :
    message = 'Yes'
    break
print(message)
a,b,k = (int(x) for x in input().split())

if k >= a :
  if k >= b :
    if a + b >= k :
      a1 = 0
      b1 = b - k + a
    else :
      a1 = 0
      b1 = 0
  else :
    a1 = 0
    b1 = b - k + a
else :
  a1 = a - k
  b1 = b

print(a1,b1)

### FIXED CODE ###

str1,str2 = input().split()
str3 = str2 + str1 
print(str3)
a, b = map(int, input().split())

x = b - a
s = 0
for i in range(1,x,1):
  s += i

ans = s - a
print(ans)

### FIXED CODE ###

N=int(input())
if N<1000:
    ans="ABC"
else:
    ans="ABD"
print(ans)
import sys

a, b = input().split(" ")
if a*b % 2 == 0:
  print("Even")
else:
  print("Odd")


### FIXED CODE ###

a, b = input().split(" ")
a = int(a)
b = int(b)
if a * b % 2 == 0:
    print("Even")
else:
    print("Odd")
import itertools
def calc_num(S,S_len):
  	result = 0;
    l = [3,5,7];
    i = 3;
    while i <= S_len
    	for v in itertools.product(l,repeat=i):
        	if int("".join(map(str,v))) <= S and list(srt(v) & set(l)) == l;
          		result = result + 1;
        i = i + 1;
    return result
  
S = list(map(int,input()))
S_len = len(S)
S = int("".join(map(str, S)));
result = calc_num(S,S_len);
print(result)

### FIXED CODE ###

import itertools
def calc_num(S,S_len):
  result = 0;
  l = [3,5,7];
  i = 3;
  while i <= S_len:
    for v in itertools.product(l,repeat=i):
      if int("".join(map(str,v))) <= S and list(set(v) & set(l)) == l:
        result = result + 1;
    i = i + 1;
  return result
  
S = list(map(int,input()));
S_len = len(S);
S = int("".join(map(str, S)));
result = calc_num(S,S_len);
print(result)