Harryxun/stf_run huggingface dataset:
S = map(int, input().split())
if S == ABC
	print("ARC")
else:
  	print("ABC")

### FIXED CODE ###

S = input()
if S == "ABC":
	print("ARC")
else:
  	print("ABC")
#何とか法, AOJのgrl1c
#初め満杯
import sys
input = sys.stdin.readline
#print = sys.stdout.write

n,m,l =map(int, input().split( ))
Edge = [[] for _ in range(n)]

for i in range(m):
    a,b,c = map(int, input().split( ))
    Edge[a-1].append([b-1,c])
    Edge[b-1].append([a-1,c])

dp = [[10**10 for _ in range(n)] for __ in range(n)]

for i in range(n):
    for ed in Edge[i]:
        dp[i][ed[0]] = ed[1]

for i in range(n):
    dp[i][i] = 0

for k in range(n):
    for j in range(n):
        for i in range(n):
            dp[i][j] = min(dp[i][j],dp[i][k] + dp[k][j])

"""
以下が要点
"""
dp2 = [[10**8 for _ in range(n)] for __ in range(n)]
for j in range(n):
    for i in range(j+1):###
        if dp[i][j] <=l:
            dp2[i][j] = 1
            dp2[j][i] = 1
for k in range(n):
    for j in range(n):
        for i in range(n):
            dp[i][j] = min(dp[i][j],dp[i][k] + dp[k][j])
"""
以上
"""
q = int(input())
ans = []
for i in range(q):
    s,t = map(int, input().split( ))
    if dp[s-1][t-1] >10**10:###
        print(-1)
    else:
        print(dp[s-1][t-1][0])
#print(dp)
#print(*ans)


### FIXED CODE ###

#何とか法, AOJのgrl1c
#初め満杯
import sys
input = sys.stdin.readline
#print = sys.stdout.write

n,m,l =map(int, input().split( ))
Edge = [[] for _ in range(n)]

for i in range(m):
    a,b,c = map(int, input().split( ))
    Edge[a-1].append([b-1,c])
    Edge[b-1].append([a-1,c])

dp = [[10**10 for _ in range(n)] for __ in range(n)]

for i in range(n):
    for ed in Edge[i]:
        dp[i][ed[0]] = ed[1]

for i in range(n):
    dp[i][i] = 0

for k in range(n):
    for j in range(n):
        for i in range(n):
            dp[i][j] = min(dp[i][j],dp[i][k] + dp[k][j])

"""
以下が要点
"""
dp2 = [[10**8 for _ in range(n)] for __ in range(n)]
for j in range(n):
    for i in range(j):
        if dp[i][j] <=l:
            dp2[i][j] = 1
            dp2[j][i] = 1
for i in range(n):
    dp2[i][i] = 1
    
for k in range(n):
    for j in range(n):
        for i in range(n):
            dp2[i][j] = min(dp2[i][j],dp2[i][k] + dp2[k][j])
"""
以上
"""
q = int(input())
ans = []
for i in range(q):
    s,t = map(int, input().split( ))
    if dp2[s-1][t-1] >10**6:###
        print(-1)
    else:
        print(dp2[s-1][t-1]-1)
#print(dp)
#print(*ans)
# coding: utf-8
# Your code here!

#aを破壊的にgcd-zetaする
def zeta_gcd(a):
    n = len(a)-1
    seive = [True]*(n+1)
    for p in range(2,n):
        if seive[p]:
            for i in range(n//p,0,-1):
                seive[p*i] = False
                a[i] += a[p*i]
                a[i] %= MOD
#    return a

#aを破壊的にgcd-mobiusする
def mobius_gcd(a):
    n = len(a)
    seive = [True]*(n+1)
    for p in range(2,n):
        if seive[p]:
            for i in range(1,n):
                if i*p >= n: break
                seive[p*i] = False
                a[i] -= a[p*i] 
                a[i] %= MOD
#    return a

################################################

#################################################

SIZE=1000001; MOD=998244353 #ここを変更する

SIZE += 1
inv = [0]*SIZE  # inv[j] = j^{-1} mod MOD
inv[1] = 1
for i in range(2,SIZE):
    inv[i] = MOD - (MOD//i)*inv[MOD%i]%MOD

################################################
#################################################
import sys
#sys.setrecursionlimit(10**6)
readline = sys.stdin.readline 

n = int(input())
a = [int(i) for i in readline().split()]

num = [0]*SIZE
for i in a: num[i] += i

assert n != 3

zeta_gcd(num)
ans = [i*i for i in num]
mobius_gcd(ans)

res = 0
for i,c in enumerate(ans):
    res = (res + c*inv[i])%MOD
for i in a:
    res = (res-i)%MOD
        
print(res*inv[2]%MOD)









### FIXED CODE ###

# coding: utf-8
# Your code here!
SIZE=1000001; MOD=998244353 #ここを変更する

SIZE += 1
inv = [0]*SIZE  # inv[j] = j^{-1} mod MOD
inv[1] = 1
for i in range(2,SIZE):
    inv[i] = MOD - (MOD//i)*inv[MOD%i]%MOD


import sys
#sys.setrecursionlimit(10**6)
readline = sys.stdin.readline 

n = int(input())
a = [int(i) for i in readline().split()]

num = [0]*1000001
db = [0]*1000001
for i in a:
    num[i] += i
    db[i] += i*i
    db[i] %= MOD

def zeta(a,n):
    sieve = [True]*(n+1)
    for p in range(2,n):
        if sieve[p]:
            for k in range(n//p,0,-1):
                sieve[k*p] = False
                a[k] += a[k*p]
                a[k] %= MOD
    return a


def meb(a,n):
    sieve = [True]*(n+1)
    for p in range(2,n):
        if sieve[p]:
            for k in range(1,n):
                if k*p >= n: break
                sieve[k*p] = False
                a[k] -= a[k*p] 
                a[k] %= MOD
    return a


#n = 1000000

n = 1000000

#zn = [i*i for i in zeta(num,n)]
#zdb = zeta(db,n)
#print(zn[:20])
#print(zdb[:20])

zn = [i*i for i in zeta(num,n)]
zdb = zeta(db,n)
ans = [i-j for i,j in zip(zn, zdb)]

#ans = [i*i-j for i,j in zip(zeta(num,n), zeta(db,n))]

#print(ans[:20])
#print(meb(ans,n)[:20])

res = 0
for i,c in enumerate(meb(ans,n+1)):
    res = (res + c*inv[i])%MOD
        
print(res*inv[2]%MOD)
N, M = map(int, input().split())
A, B = list(zip(*[list(map(int, input().split())) for _ in range(M)]))

G = []
m = {}
for a, b in zip(A, B):
    if a not in m and b not in m:
        G.append({a, b})
        m[a] = len(G) - 1
        m[b] = len(G) - 1
    elif a in m:
        gid = m[a]
        G[gid].add(b)
    elif b in m:
        gid = m[b]
        G[gid].add(a)

max_size = max(len(g) for g in G)
print(max_size)


### FIXED CODE ###

class UnionFind:

    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {root: self.members(root) for root in self.roots()}

    def __str__(self):
        return '\n'.join(f'{root}: {self.members(root)}' for root in self.roots())


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

uf = UnionFind(N)
for _ in range(M):
    a, b = map(int, input().split())
    uf.union(a - 1, b - 1)

print(max(uf.size(i) for i in range(N)))
X = int(input())
P = make_primes_list(100005)

def make_primes_list(n):
    primes = set(range(2, n+1))
    for i in range(2, int(n**0.5+1)):
        primes.difference_update(range(i*2, n+1, i))
    primes=list(primes)
    return primes

for x in range(X,100005):
    if x in P:
        print(x)
        break

### FIXED CODE ###

X = int(input())

def make_primes_list(n):
    primes = set(range(2, n+1))
    for i in range(2, int(n**0.5+1)):
        primes.difference_update(range(i*2, n+1, i))
    primes=list(primes)
    return primes

P = make_primes_list(100005)

for x in range(X,100005):
    if x in P:
        print(x)
        break
import math

n = int(input().strip())
an = list(map(int, input().strip().split(' ')))


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


temp = an[0]
for i in range(len(an)):
    temp = lcm(temp, an[i])

m = temp - 1

ret = 0
for a in an:
    ret += m % a

print(ret)


### FIXED CODE ###


import fractions

n = int(input().strip())
an = list(map(int, input().strip().split(' ')))


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


temp = an[0]
for i in range(len(an)):
    temp = lcm(temp, an[i])

m = temp - 1

ret = 0
for a in an:
    ret += m % a

print(ret)
N = int(input())
cards = sorted(list(map(int, input().split())), reverse=True)

A = 0
B = 0
idx = 0
for card in cards:
    if idx % 2 == 0:
        A += card
    else:
        B += card
    idx += 1


print(str(A-B))
~

### FIXED CODE ###

N = int(input())
cards = sorted(list(map(int, input().split())), reverse=True)

A = 0
B = 0
idx = 0
for card in cards:
    if idx % 2 == 0:
        A += card
    else:
        B += card
    idx += 1
result = A - B
print(result)
s = input()
k = int(input())
ls = len(s)

word_list = []

a = s[0]
b = 1
for i, v in enumerate(s[1:],1):
    if a != v:
        word_list.append((a,b))
        a = v
        b = 1
    else:
        b += 1
    if i == ls-1:
        word_list.append((a,b))

ans = 0
if len(word_list) == 1:
    ans = (word_list[0][1] * k) // 2
else:
    if word_list[-1][0] != word_list[0][0]:
        for i in word_list:
            ans += (i[1])//2
        ans *= k
    else:
        head, *body, tail = word_list

        for i in body:
            ans += (i[1])//2
        ans *= k
        ans += head[1] // 2
        ans += tail[1] // 2
        headtail = (head[1]+tail[1]) //2 *(k-1)
        ans += headtail
print(ans) 


### FIXED CODE ###


s = input()
k = int(input())
ls = len(s)

word_list = []

a = ""
b = 1

for i, v in enumerate(s):
    if a != v:
        if a != "":
            word_list.append((a,b))
        a = v
        b = 1
    else:
        b += 1
    if i == ls-1:
        word_list.append((a,b))

ans = 0
if len(word_list) == 1:
    ans = (word_list[0][1] * k) // 2
else:
    if word_list[-1][0] != word_list[0][0]:
        for i in word_list:
            ans += (i[1])//2
        ans *= k
    else:
        head, *body, tail = word_list

        for i in body:
            ans += (i[1])//2
        ans *= k
        ans += head[1] // 2
        ans += tail[1] // 2
        headtail = (head[1]+tail[1]) //2 *(k-1)
        ans += headtail

print(ans)
s={i:list(input())for i in'abc'}
i='a'
while d[i]:i=s[i].pop(0)
print(i.upper())

### FIXED CODE ###

s={i:list(input())for i in'abc'}
i='a'
while s[i]:i=s[i].pop(0)
print(i.upper())
S = input()
print("Yes" if S[3] == S[4] and S[5] == S[6] else "No")


### FIXED CODE ###

S = input()
print("Yes" if S[2] == S[3] and S[4] == S[5] else "No")
#!/usr/bin/python3
# -*- coding: utf-8 -*-

def main():
    n = int(input())
    a = tuple(tuple(e for e in map(int, input().split())) for _ in range(2))
    dp = [[None] * n for _ in range(2)]
    dp[0][0] = 0
    for i in range(2):
        for j in range(n):
            if i == 0:
                dp[0][j] = dp[0][max(0, j - 1)] + a[0][j]
            else:
                dp[1][j] = max(dp[0][j], dp[1][max(0, j - 1)]) + a[1][j]
    print(dp[1][n - 1])

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/python3
# -*- coding: utf-8 -*-

def main():
    n = int(input())
    a = tuple(tuple(e for e in map(int, input().split())) for _ in range(2))
    dp = [[None] * n] * 2
    dp[0][0] = 0
    for i in range(2):
        for j in range(n):
            if i == 0:
                dp[0][j] = dp[0][max(0, j - 1)] + a[0][j]
            else:
                dp[1][j] = max(dp[0][j], dp[1][max(0, j - 1)]) + a[1][j]
    print(dp[1][n - 1])

if __name__ == '__main__':
    main()
def dfs(cur, par, g, d):
    pars[cur] = par
    for to in g[cur]:
        if to == par:
            continue
        d[to] = d[cur]+1
        md[cur] = max(md[cur], dfs(to, cur, g, d)+1)
    return md[cur]


n, u, v = map(int, input().split())
u -= 1
v -= 1
g = []
for i in range(n):
    g.append([])
for i in range(n-1):
    a, b = map(int, input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)
# d = []
# md = []
# pars = []
# f = []
# for i in range(n):
#     d.append(-1)
#     md.append(0)
#     pars.append(-1)
#     f.append(False)
# d[u] = 0
# dfs(u, -1, g, d)
# cur = v
# while cur != u:
#     f[cur] = True
#     cur = pars[cur]
# pars[u] = True
# res = d[v]//2
# for i in range(n):
#     if f[i] and d[i]*2 < d[v]:
#         for to in g[i]:
#             if to == pars[i] or f[to]:
#                 continue
#             res = max(res, md[to]+1+d[v]-d[i] - 1)
print(res)


### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)


def dfs(cur, par, g, d):
    pars[cur] = par
    for to in g[cur]:
        if to == par:
            continue
        d[to] = d[cur]+1
        md[cur] = max(md[cur], dfs(to, cur, g, d)+1)
    return md[cur]


n, u, v = map(int, input().split())
u -= 1
v -= 1
g = []
for i in range(n):
    g.append([])
for i in range(n-1):
    a, b = map(int, input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)
d = []
md = []
pars = []
f = []
for i in range(n):
    d.append(-1)
    md.append(0)
    pars.append(-1)
    f.append(False)
d[u] = 0
dfs(u, -1, g, d)
cur = v
while cur != u:
    f[cur] = True
    cur = pars[cur]
f[u] = True
res = d[v]-1
for i in range(n):
    if f[i] and d[i]*2 < d[v]:
        for to in g[i]:
            if to == pars[i] or f[to]:
                continue
            res = max(res, md[to]+1+d[v]-d[i] - 1)
print(res)
G,R= map(int, input().split())
print(2*R-G)

### FIXED CODE ###

R = int(input())
G = int(input())
print(2*G-R)
N=int(input())
ans=[0 for a in range(100)]
for i in range(1,101):
  for x in range(1,101):
    for y in range(1,101):
      v=x*x+y*y+i*i+x*y+y*i+i*x
      if v<=N:
        ans[v]+=1
for b in range(1,N+1):
  print(ans[b])
      

### FIXED CODE ###

N=int(input())
ans=[0 for a in range(11000)]
for i in range(1,101):
  for x in range(1,101):
    for y in range(1,101):
      v=x*x+y*y+i*i+x*y+y*i+i*x
      if v<=N:
        ans[v]+=1
for b in range(1,N+1):
  print(ans[b])
N = int(input())
A = list(map(int, input().split()))

ans = []
mx = max(A)
mi = min(A)

if mx * mi < 0:
    if abs(mi) > abs(mx):
        x = A.index(mi)
        for y in range(N):
            if y == x:
                continue
            A[y] += mi
            ans.append((x, y))
    else:
        x = A.index(mx)
        for y in range(N):
            if x == y:
                continue
            A[y] += mx
            ans.append((x, y))


for i in range(N - 1)[::(-1)**(max(A) < 0)]:
    l, r = A[i], A[i + 1]

    if l > r:
        if r >= 0:
            A[i + 1] += l
            ans.append((i, i + 1))
        if l <= 0:
            A[i] += r
            ans.append((i + 1, i))

print(len(ans))
for x, y in ans:
    print(x + 1, y + 1)

if list(sorted(A)) != A:
    print(A)
    1 / 0


### FIXED CODE ###

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

ans = []
mx = max(A)
mi = min(A)

if mx * mi < 0:
    if abs(mi) > abs(mx):
        x = A.index(mi)
        for y in range(N):
            if y == x:
                continue
            A[y] += mi
            ans.append((x, y))
    else:
        x = A.index(mx)
        for y in range(N):
            if x == y:
                continue
            A[y] += mx
            ans.append((x, y))

for i in range(N - 1)[::(-1)**(min(A) < 0)]:
    l, r = A[i], A[i + 1]

    if l > r:
        if r >= 0:
            A[i + 1] += l
            ans.append((i, i + 1))
        elif l <= 0:
            A[i] += r
            ans.append((i + 1, i))

print(len(ans))
for x, y in ans:
    print(x + 1, y + 1)

if list(sorted(A)) != A:
    print(A)
    1 / 0
a, b, c, d=map(int,input().split)
k1=abs(a-b)
k2=abs(a-c)
k3=abs(b-c)
if (k2<=d):
  print("Yes")
elif (k1<=d || k2<=d):
  print("Yes")
else print("No")

### FIXED CODE ###

a, b, c, d=map(int,input().split())
k1=abs(a-b)
k2=abs(a-c)
k3=abs(b-c)
if k2<=d:
  print("Yes")
elif k1<=d and k3<=d:
  print("Yes")
else:
  print("No")
from bisect import bisect_left, insort_left
import sys
def main():
	readlines = sys.stdin.readline
	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:]
	ans = sum(p) + sum(q)
	p_count = 0
	q_count = 0

	for i in range(c):
		if p[p_count] < r[i] and q[q_count] < r[i]:
			if p[p_count] < q[q_count]:
				ans -= p[p_count]
				ans += r[i]
				#insort_left(p,r[i])
				if p_count < a-1:
					p_count += 1
			else:
				ans -= q[q_count]
				ans += r[i]
				#insort_left(q,r[i])
				if q_count < b-1:
					q_count += 1
		elif p[p_count] < r[i]:
			ans -= p[p_count]
			ans += r[i]
			#insort_left(p,r[i])
			if p_count < a-1:
				p_count += 1
		elif q[q_count] < r[i]:
			ans -= q[q_count]
			ans += r[i]
			#insort_left(q,r[i])
			if q_count < b-1:
				q_count += 1
		else:
			break

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

### 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 resolve():
    N, K = map(int, input().split())
    A = tuple(map(int, input().split()))
    C = [0]*N
    path = []
    cur = 1
    for i in range(K):
        C[cur-1] += 1
        path.append(cur)
        cur = A[cur-1]
        if C.count(2) >= 1:
            init_c = path.index(cur) + 1
            break
    MOD = (K+1) % (len(path) - 1)
    for i in range(init_c, init_c+MOD+1):
        init_c = A[init_c]
    print(init_c)

if __name__ == '__main__':
    resolve()

### FIXED CODE ###

def resolve():
    N, K = map(int, input().split())
    A = tuple(map(int, input().split()))
    path = [1]
    for i in range(2*N):
        cur = A[path[-1]-1]
        path.append(cur)

    if K < N:
        print(path[K])
        exit()

    end = N
    si = N-1
    while path[si] != path[end]:
        si -= 1
    dist = end - si
    K = K % dist
    while K < N:
        K += dist

    print(path[K])

if __name__ == '__main__':
    resolve()
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
num=[]
amax=max(A)
for i in range(amax):
    num.append(A.count(i))

total=sum(A)
for i in range(Q):
    B, C = map(int, input().split())
    print(total + (C - B) * num[B])
    total=total + (C - B) * num[B]
    num[C] += num[B]
    num[B] -= num[B]
    

### FIXED CODE ###

alpha=str(input())
check=alpha.isupper()

if check==True:
    print("A")
else:
    print("a")
n,l = map(int,input().split())
A = list(map(int,input().split()))
x = -1
for i in range(n-1):
  if a[i]+a[i+1] >= l:
    x = i
    break
if x == -1:
  print('Impossible')
else:
  print('Possible')
  for i in range(x-1):
    print(i+1)
  for i in range(n-1,x,-1):
    print(i)
  print(x)


### FIXED CODE ###

n,l = map(int,input().split())
a = list(map(int,input().split()))
x = -1
for i in range(n-1):
  if a[i]+a[i+1] >= l:
    x = i
    break
if x == -1:
  print('Impossible')
else:
  print('Possible')
  for i in range(x):
    print(i+1)
  for i in range(n-2,x,-1):
    print(i+1)
  print(x+1)
a = input()
 
if a[-1] == 's':
  print(a end='es')
else:
  print(a end='s')

### FIXED CODE ###

a = input()
 
if a[-1] == 's':
  print(a, end='es')
else:
  print(a, end='s')
import sys
input = sys.stdin.readline
num = []
iti = []

for temp in range(5):
    temp2 = input()
    temp3 = int(temp2)
    if temp3 > 10 and temp2[-2] != "0":
        num.append((int(temp2[0:-2])+1)*10)
    elif temp2[-2] == "0":
        num.append(int(temp2[0:-2])*10)
    else:
        num.append(10)
    if int(temp2[-2]) != 0:
        iti.append(int(temp2[-2]))

print(sum(num)-10+min(iti))

### FIXED CODE ###

import sys
input = sys.stdin.readline
num = []
iti = []

for temp in range(5):
    temp2 = input()
    temp3 = int(temp2)
    if temp3 >= 10 and temp2[-2] != "0":
        num.append((int(temp2[0:-2])+1)*10)
    elif temp2[-2] == "0":
        num.append(int(temp2[0:-2])*10)
    else:
        num.append(10)
    if int(temp2[-2]) != 0:
        iti.append(int(temp2[-2]))

if iti == []:
    last = 10
else:
    last = min(iti)
print(sum(num)-10+last)
a, b = map(int, input.split())
print(max(int(str(a)*b), int(str(b)*a)))

### FIXED CODE ###

a, b = map(int, input().split())
print(max(int(str(a)*b), int(str(b)*a)))
import sys
n = int(input())
lst = []
for _ in range(n):
    a = int(sys.stdin.readline())
    lst.append([[i for i in sys.stdin.readline().split()] for _ in range(a)])
m = 0
for i in range(2 ** n):
    a = True
    d = 0
    for j in range(n):
        if i >> j & 1:
            d += 1
            for x, y in lst[j]:
                if bin(i)[- int(x)] != y:
                    a = False
                    break
    if a:
        m = max(m, d)
print(m)

### FIXED CODE ###

n = int(input())
lst = []
for _ in range(n):
    a = int(input())
    lst.append([[int(i) for i in input().split()] for _ in range(a)])
m = 0
for i in range(2 ** n):
    a = True
    for j in range(n):
        if i >> j & 1:
            for x, y in lst[j]:
                if (i >> (x - 1) & 1) != y:
                    a = False
                    break
    if a:
        m = max(m, sum(map(int, bin(i)[2:])))
print(m)
D, N = map(int,input().split())
if N != 100:
    print(N*100**D)
else:
    print(N*100**D + 1)
D, N = map(int,input().split())
if N != 100:
    print(N*100**D)
else:
    print((N+1)*100**D)


### FIXED CODE ###

a, b = map(int, input().split())
if a <= 8 and b<= 8:
    print("Yay!")
else:
    print(":(")
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a=sorted(a,reverse=True)
b=sorted(b)

def ok(N):
    sums=0
    for i in range(n):
        sums+=max(0,a[i]-N//b[i])
    if sums<=k:
        return True
    else:
        return False
    
import math

left=0
right=a[0]*b[-1]
for _ in range(math.ceil(math.log2(right))):
    if ok(math.floor((left+right)/2)):
      left=left
      right=(left+right)/2
    elif not ok(math.floor((left+right)/2)):
      left=(left+right)/2
      right=right
print(math.floor(right))
   


### FIXED CODE ###

# いきぬきreview　忘れた問題
# gluttony
N, K = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))
F.sort()
A.sort(reverse=True)


def func(X):
    s = 0
    for i in range(N):
        a, f = A[i], F[i]
        s += max(0, a-X//f)
    return s <= K


R = 10**12
L = -1
while R-L > 1:
    m = (R+L)//2
    if func(m):
        R = m
    else:
        L = m
print(R)
from math import sqrt

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

for i in range(N - 1):
    dist = 0
    for j in range(i + 1, N):
        for k in range(D):
            dist += (X[i][k] - X[j][k]) ** 2
        if sqrt(dist) % 1 == 0:
            ans += 1
    
print(ans)

### FIXED CODE ###

from math import sqrt

N, D = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]
ans = 0

for i in range(N - 1):
    for j in range(i + 1, N):
        dist = 0
    
        for k in range(D):
            dist += (X[i][k] - X[j][k])**2
        
        if sqrt(dist) % 1 == 0:
            ans += 1
    
print(ans)
m,n = map(int,input().split())
l = list(map(int,input().split()))
for i in range(n):
  s += l[i]
print(max(m-s,-1))

### FIXED CODE ###

m,n = map(int,input().split())
l = list(map(int,input().split()))
s = 0
for i in range(n):
  s += l[i]
print(max(m-s,-1))
import math
N = int(input())
A = list(map(int, input().split()))
d = math.gcd(A[0], A[1])
for i in range(2, N):
    d = math.gcd(d, A[i])
print(d)

### FIXED CODE ###

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

N = int(input())
A = list(map(int, input().split()))
d = gcd(A[0], A[1])
for i in range(2, N):
    d = gcd(d, A[i])
print(d)