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

ans_l = []
for num in range(min(a, b)):
  if a % num == 0 and b % num == 0:
    ans_l.append(num)

sorted(ans_l)

print(ans_l[-k])

### FIXED CODE ###

a, b, k = list(map(int, input().split()))
 
ans_l = []
for num in range(1, min(a, b) + 1):
  if a % num == 0 and b % num == 0:
    ans_l.append(num)


print(ans_l[-k])
import sys
from math import factorial
sys.setrecursionlimit(100000)

input = sys.stdin.readline

X, Y = list(map(int,input().split()))

mod = 10**9 + 7

def mm(a, b):
    return ((a % mod) * (b % mod)) % mod

def pp(x, y):
    if   y == 0     :
    	return 1
    elif y == 1     : 
    	return x % mod
    elif y % 2 == 0 : 
    	return (pp(x, y/2)**2) % mod
    else            : 
    	return (pp(x, y//2)**2 * x) % mod

def dd(a, b):
    return mm(a, pp(b, mod-2))

def xgcd(a, b):
	x0, y0, x1, y1 = 1, 0, 0, 1
	while b != 0:
	    q, a, b = a // b, b, a % b
	    x0, x1 = x1, x0 - q * x1
	    y0, y1 = y1, y0 - q * y1
	return a, x0, y0

def modinv(a, m):
    g, x, y = xgcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

if (X+Y)%3!=0:
	ans = 0
else:
	nmsum = (X+Y)//3
	nmdif = Y-X
	if (nmsum+nmdif)%2!=0:
		ans = 0
	else:
		n = (nmsum+nmdif)//2
		m = (nmsum-nmdif)//2
		if n<0 or m<0:
			ans = 0
		else:
			t = 1
			for i in range(1,n+m+1):
				t = (t*i)%mod
				if i==n: bb = t
				if i==m: cc = t
				if i==n+m: aa = t
			# aa = factorial(n+m)%mod
			# bb = factorial(n)%mod
			# cc = factorial(m)%mod
			ans = aa * modinv(bb,mod) %mod
			ans = ans * modinv(cc,mod) %mod

print(ans)

### FIXED CODE ###

import sys
from math import factorial
sys.setrecursionlimit(100000)

input = sys.stdin.readline

X, Y = list(map(int,input().split()))

mod = 10**9 + 7

def mm(a, b):
    return ((a % mod) * (b % mod)) % mod

def pp(x, y):
    if   y == 0     :
    	return 1
    elif y == 1     : 
    	return x % mod
    elif y % 2 == 0 : 
    	return (pp(x, y/2)**2) % mod
    else            : 
    	return (pp(x, y//2)**2 * x) % mod

def dd(a, b):
    return mm(a, pp(b, mod-2))

def xgcd(a, b):
	x0, y0, x1, y1 = 1, 0, 0, 1
	while b != 0:
	    q, a, b = a // b, b, a % b
	    x0, x1 = x1, x0 - q * x1
	    y0, y1 = y1, y0 - q * y1
	return a, x0, y0

def modinv(a, m):
    g, x, y = xgcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

if (X+Y)%3!=0:
	ans = 0
else:
	nmsum = (X+Y)//3
	nmdif = Y-X
	if (nmsum+nmdif)%2!=0:
		ans = 0
	else:
		n = (nmsum+nmdif)//2
		m = (nmsum-nmdif)//2
		if n<0 or m<0:
			ans = 0
		elif n==0 or m==0:
			ans = 1
		else:
			t = 1
			for i in range(1,n+m+1):
				t = (t*i)%mod
				if i==n: bb = t
				if i==m: cc = t
				if i==n+m: aa = t
			# aa = factorial(n+m)%mod
			# bb = factorial(n)%mod
			# cc = factorial(m)%mod
			ans = aa * modinv(bb,mod) %mod
			ans = ans * modinv(cc,mod) %mod

print(ans)
import math
while True:
	n = int(raw_input())
	if n==0:
		break
	sum = 0
	for i in xrange(n):
		s = map(int,raw_input().split())
		sum += s[i]
	ave = sum/n
	sum = 0
	for i in xnrange(n):
		sum += pow(s[i] - ave,2.0)
	print math.sqrt(sum/n)
	

### FIXED CODE ###

import math
while True:
	n = int(raw_input())
	if n==0:
		break
	s = map(int,raw_input().split())
	ave = sum = 0.0
	for i in xrange(n):
		ave += s[i]
	ave /= n
	for i in xrange(n):
		sum += math.pow(s[i] - ave, 2.0)
	print math.sqrt(sum/n)
n = int(input())
s = list(map(int, input().split()))
for i in range(n):
  if s[i] == "Y":
    print("Four")
    exit()
print("Three")

### FIXED CODE ###

n = int(input())
s = input().split()
for i in range(n):
  if s[i] == "Y":
    print("Four")
    exit()
print("Three")
def check(x, y):
	array[x][y] = "0"
	if array[x + 1][y] == "1" : check(x + 1, y)
	if array[x - 1][y] == "1" : check(x - 1, y)
	if array[x][y + 1] == "1" : check(x, y + 1)
	if array[x][y - 1] == "1" : check(x, y - 1)
	if array[x + 1][y + 1] == "1" : check(x + 1, y + 1)
	if array[x + 1][y - 1] == "1" : check(x + 1, y - 1)
	if array[x - 1][y + 1] == "1" : check(x - 1, y + 1)
	if array[x - 1][y - 1] == "1" : check(x - 1, y - 1)

while True:
	h,w = map(int, raw_input().split())
	if h == 0 and w == 0 : break

	array = []
	array.append(list("0" * (2 + h)))
	for i in range(0, w) : array.append(list("0" + raw_input().replace(" ", "") + "0"))
	array.append(list("0" * (2 + h)))
	
	count = 0
	for i in range(1, h + 1):
		for j in range(1, w + 1):
			if array[i][j] == "1":
				check(i, j)
				count += 1
				
	print count

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

def check(x, y):
	array[x][y] = "0"
	if array[x + 1][y] == "1" : check(x + 1, y)
	if array[x - 1][y] == "1" : check(x - 1, y)
	if array[x][y + 1] == "1" : check(x, y + 1)
	if array[x][y - 1] == "1" : check(x, y - 1)
	if array[x + 1][y + 1] == "1" : check(x + 1, y + 1)
	if array[x + 1][y - 1] == "1" : check(x + 1, y - 1)
	if array[x - 1][y + 1] == "1" : check(x - 1, y + 1)
	if array[x - 1][y - 1] == "1" : check(x - 1, y - 1)

while True:
	h,w = map(int, raw_input().split())
	if h == 0 and w == 0 : break

	array = []
	array.append(list("0" * (2 + h)))
	for i in range(0, w) : array.append(list("0" + raw_input().replace(" ", "") + "0"))
	array.append(list("0" * (2 + h)))
	
	count = 0
	for i in range(1, w + 1):
		for j in range(1, h + 1):
			if array[i][j] == "1":
				check(i, j)
				count += 1
				
	print count
pc = list(map(int, input().split("")))

if pc[0] != pc[1] and pc[1] != pc[2] and pc[2] != pc[3] :
  print("Good")
else :
  print("Bad")

### FIXED CODE ###

pc = input()

if pc[0] != pc[1] and pc[1] != pc[2] and pc[2] != pc[3] :
  print("Good")
else :
  print("Bad")
import sys
H, W, M = map(int, input().split())
Hb = [0] * H
Wb = [0] * W
B = [[0] * W for _ in range(H)]
for _ in range(M):
    h, w = map(int, input().split())
    Hb[h - 1] += 1
    Wb[w - 1] += 1
    B[h - 1][w - 1] = 1
HB = max(Hb)
WB = max(Wb)
x = set()
y = set()
for i in range(H):
    if Hb[i] == HB:
        y.add(i)
for i in range(W):
    if Wb[i] == WB:
        x.add(i)
for i in y:
    for j in x:
        if B[i][j] == 0:
            print(HB + WB)
            sys.exit()
print(HB + WB - 1)

### FIXED CODE ###

import sys
H, W, M = map(int, input().split())
Hb = [0] * H
Wb = [0] * W
B = set()
for _ in range(M):
    h, w = map(int, input().split())
    Hb[h - 1] += 1
    Wb[w - 1] += 1
    B.add((h - 1, w - 1))
HB = max(Hb)
WB = max(Wb)
x = set()
y = set()
for i in range(H):
    if Hb[i] == HB:
        y.add(i)
for i in range(W):
    if Wb[i] == WB:
        x.add(i)
for i in y:
    for j in x:
        if (i, j) not in B:
            print(HB + WB)
            sys.exit()
print(HB + WB - 1)
import itertools
l,r = map(int,input().split(" "))

if r-l > 2019:
    print(0)
else:
    ret = 2020
print(ret)


### FIXED CODE ###

import itertools
l,r = map(int,input().split(" "))

if r-l > 2019:
    print(0)
else:
    ret = 2020
    for i in itertools.combinations(range(l,r+1,1),2):
        ret = min(ret,(i[0]*i[1])%2019)
    print(ret)
S = input()
N = len(S)

x = (N-1)/2
y = (N+3)/2

a = S[:x]
b = S[y:N]

if a == reversed(a) and b == reversed(b):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

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

even = N*(N-1)/2
odd = M*(M-1)/2

print(int(even + odd))
def main():
    N = int(input())
    A = sorted(list(map(int, input().split())))
    B = sorted(list(map(int, input().split())))
    C = sorted(list(map(lambda x: int(x)-1, input().split())))


    BC = []
    for i in range(N):
        b = B[i]
        BC.append(N - bisect_left(C, b))

    Cum = []
    S = sum(BC)
    tmp = S
    for i in range(N):
        Cum.append(tmp)
        tmp -= BC[i]
    Cum.append(0)

    count = 0
    for i in range(N):
        a = A[i]
        count += Cum[bisect_right(B, a)]

    print(count)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from bisect import bisect_left, bisect_right, insort_left, insort_right

def main():
    N = int(input())
    A = sorted(list(map(int, input().split())))
    B = sorted(list(map(int, input().split())))
    C = sorted(list(map(lambda x: int(x)-1, input().split())))


    BC = []
    for i in range(N):
        b = B[i]
        BC.append(N - bisect_left(C, b))

    Cum = []
    S = sum(BC)
    tmp = S
    for i in range(N):
        Cum.append(tmp)
        tmp -= BC[i]
    Cum.append(0)

    count = 0
    for i in range(N):
        a = A[i]
        count += Cum[bisect_right(B, a)]

    print(count)


if __name__ == "__main__":
    main()
from fractions import gcd
from functools import reduce

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == '__main__':
    n, m = list(map(int, input().split(" ")))
    a = list(map(int, input().split(" ")))
    a = list(set(a))

    # for j in a:
    #     if j % 2 != 0:
    #         print("0")

    # a = [i/2 for i in a]
    l = lcm_list(a)

    if l == 0:
        print(0)
        exit()

    i = l / 2

    for j in a:
        if i // (j // 2) % 2 == 0:
            print(0)
            exit()

    if m < i:
        print("0")
    else:
        print(int(((m - i) // (l)) + 1))

### FIXED CODE ###

from fractions import gcd
from functools import reduce
import sys
sys.setrecursionlimit(10 ** 7)

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == '__main__':
    n, m = list(map(int, input().split(" ")))
    a = list(map(int, input().split(" ")))
    a = list(set(a))

    # for j in a:
    #     if j % 2 != 0:
    #         print("0")

    # a = [i/2 for i in a]
    l = lcm_list(a)

    # if l == 0:
    #     print(0)
    #     exit()

    if (2 * m) < l:
        print("0")
        exit()

    i = l / 2

    for j in a:
        if i // (j // 2) % 2 == 0:
            print(0)
            exit()

    # if m < i:
    #     print("0")
    else:
        # print("1")
        print(int(((m - i) // l) + 1))
        # print(int((m // i + 1) // 2))
l = list(map(int, input.split()))
print(sum(l)+max(l)*9)

### FIXED CODE ###

l = list(map(int, input().split()))
print(sum(l)+max(l)*9)
h,w = map(int,input().split())
for i in range(h+2):
  if i ==0 or i == h+1:
    for d in range(w+2):
      print("#",end="")
      continue
  print("#"+input()+"#")


### FIXED CODE ###

h,w = map(int,input().split())
for i in range(h+2):
  if i ==0 or i == h+1:
    for d in range(w+1):
      print("#",end="")
    print("#")
    continue
  print("#"+input()+"#")
a, b = map(int, input().split())
if (a*b) % 2 == 0:
  print('Even')
else
  print('Odd')

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2 == 0:
  print('Even')
else:
  print('Odd')
a,b,c=map(int,input().split())

print(max(a,b,c)*9+sum(a,b,c)

### FIXED CODE ###

l=list(map(int,input().split()))
print(max(l)*9+sum(l))
import sys
sys.setrecursionlimit(100000000000)

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

li2 = []
for i in range(1, len(li1)):
    li2.append(li1[i-1] - li1[i])
    
cnt1 = 0
cnt2 = 0
li3 = []

for i in li2:
    cnt2 += 1
    if i < 0:
        li3.append(cnt1)
        cnt1 = 0
    else:
        cnt1 += 1
    if cnt2 == len(li2):
        li3.append(cnt1)

print(max(li3))

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

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

li2 = []
for i in range(1, len(li1)):
    li2.append(li1[i-1] - li1[i])
    
cnt1 = 0
cnt2 = 0
li3 = []

for i in li2:
    cnt2 += 1
    if i < 0:
        li3.append(cnt1)
        cnt1 = 0
    else:
        cnt1 += 1

li3.append(cnt1)

print(max(li3))
N, M = map(int, input().split())

class UnionFind():
    def __init__(self, N):
        self.nodes = [i for i in range(N)]

    def root(self, x):
        if self.nodes[x] != x:
            self.nodes[x] = self.root(self.nodes[x])
        return self.nodes[x]

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

    def unite(self, x, y):
        if self.same(x, y):
            return
        self.nodes[self.root(x)] = self.root(y)

uf = UnionFind(N)
anti_list = [[] for _ in range(N)]

for _ in range(M):
    x, y, z = map(int, input().split())
    uf.unite(x-1, y-1)

group = set()
for node in uf.nodes:
    group.add(uf.root(node))

print(len(group))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)

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

class UnionFind():
    def __init__(self, N):
        self.nodes = [i for i in range(N)]

    def root(self, x):
        if self.nodes[x] != x:
            self.nodes[x] = self.root(self.nodes[x])
        return self.nodes[x]

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

    def unite(self, x, y):
        if self.same(x, y):
            return
        self.nodes[self.root(x)] = self.root(y)

uf = UnionFind(N)

for _ in range(M):
    x, y, z = map(int, input().split())
    uf.unite(x-1, y-1)

group = set()
for node in uf.nodes:
    group.add(uf.root(node))

print(len(group))
N,M,K = list(map(int,input().split()))
F = []
C = [0]*N #友達の数を記録。
for i in range(M):
    a,b = list(map(int,input().split()))
    C[a-1] += 1
    C[b-1] += 1
    # print("a,b =",a,b)
    ia,ib = -1,-1
    for i in range(len(F)):
        if a in F[i]:
            ia = i
        if b in F[i]:
            ib = i
    # print(ia,ib)
    if ia == -1 and ib == -1:
        F.append([a,b])
    elif ia != -1 and ib == -1:
        F[ia].append(b)
    elif ia == -1 and ib != -1:
        F[ib].append(a)
    else:
        if ia != ib:
            F[ia] += F[ib]
            F.pop(ib)
# print("Group:",F)
# print("The number of friends:",C)
B = []
for i in range(K):
    a = list(map(int,input().split()))
    B.append(a)
# print("Blocks:",B)

# 友達候補者配列
Y = [0]*N
for i in range(N):#人iについて
    l = 1
    # print(i+1,"人目")
    for g in F:
        if i+1 in g:
            g1 = g
            l = len(g)
    # print(g1)
    # print(l)
    # ブロック中の人間を除く。
    for b in B:
        if i+1 in b:
            # print("block!!")
            if b[b.index(i+1)-1] in g1:
                l -= 1
    Y[i] = l-1 - C[i]

# print(C)
print(" ".join(map(str,Y)))
    

### FIXED CODE ###

def find(x):
    if par[x]<0:
        return x
    else:
        par[x]=find(par[x])
        return par[x]
 
def unite(x,y):
  x,y=find(x),find(y)
  if x!=y:
    if x>y:
        x,y=y,x
    par[x]+=par[y]
    par[y]=x
    
def same(x,y):
  return find(x)==find(y)
 
def size(x):
  return-par[find(x)]
 
N,M,K = map(int,input().split())
par=[-1]*N
B = [set() for _ in range(N)]
FF = [0]*N
for _ in range(M):
    a,b = map(int,input().split())
    unite(a-1,b-1)
    FF[a-1] += 1
    FF[b-1] += 1
# print(F)
for j in range(K):
    a,b = map(int,input().split())
    B[a-1].add(b-1)
    B[b-1].add(a-1)

Y = []
for i in range(N):
    y = size(i) - FF[i] -1
    for b in B[i]:
        if same(i,b):
            y += -1
    Y.append(str(y))
print(" ".join(Y))
cij =[]
for i in range(3):
    cij.append(list(map(int, input().split(" "))))

bi_list = []
for b1 in range(-500000, 500000):
    b2 = b1 - (cij[0][0] - cij[0][1])
    b3 = b1 - (cij[0][0] - cij[0][2])

    a1 = cij[0][0]+cij[0][1]+cij[0][2] -b1-bi2-b3
    a2 = cij[1][0]+cij[1][1]+cij[1][2] -b1-b2-b3
    a3 = cij[2][0]+cij[2][1]+cij[2][2] -b1-b2-b3
    if (a1) % 3 == 0 and (a2) % 3 == 0 and (a3) % 3 == 0:
        print("Yes")
        exit()

print("No")


### FIXED CODE ###

cij =[]
for i in range(3):
    cij.append(list(map(int, input().split(" "))))

bi_list = []
for b1 in range(-50000, 50000):
    b2 = b1 - (cij[0][0] - cij[0][1])
    b3 = b1 - (cij[0][0] - cij[0][2])

    a1 = cij[0][0]+cij[0][1]+cij[0][2] -b1-b2-b3
    a2 = cij[1][0]+cij[1][1]+cij[1][2] -b1-b2-b3
    a3 = cij[2][0]+cij[2][1]+cij[2][2] -b1-b2-b3
    if a1/3+b1 ==cij[0][0] and a1/3+b2 ==cij[0][1] and a1/3+b3 ==cij[0][2] and a2/3+b1 ==cij[1][0] and a2/3+b2 ==cij[1][1] and a2/3+b3 ==cij[1][2] and a3/3+b1 ==cij[2][0] and a3/3+b2 ==cij[2][1] and a3/3+b3 ==cij[2][2]:
            print("Yes")
            exit()

print("No")
N = int(input())
A = list(map(int,input().split()))
A.sort()
p = N//2
ans =sum(A[p:])-sum(A[:p])
hoge = ans
for i in range(p,N-1):
    hoge -= A[i]*2
    if hoge > ans:
        p = i
        ans = hoge
print(hoge)
B=[0]*N
l =0
hoge = A[p+1]
for i in range(p+2,N):
    print(A[l],hoge)
    hoge = A[l]-hoge
    l += 1
    print(A[i],hoge)
    hoge = A[i]-hoge
for i in range(l,p+1):
    print(hoge,A[i])
    hoge -= A[i]

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
A.sort()
ans = 0
hoge = sum(A)
p = 0
for i in range(N-1):
    hoge -= A[i]*2
    if hoge > ans:
        ans = hoge
        p = i
print(ans)
hoge = A[0]
for i in range(p+1,N-1):
    print(hoge,A[i])
    hoge -= A[i]
print(A[N-1],hoge)
hoge = A[N-1] - hoge
for i in range(1,p+1):
    print(hoge,A[i])
    hoge -= A[i]
import math
A,B,C,D = list(map(int,input().split()))
A -= 1
lcn = C * D / math.gcd(C,D) 
m_n = B - B // C - B // D + B // lcn
min_n = A - A // C - A // D + A // lcn
print(int(m_n-min_n))

### FIXED CODE ###

A,B,C,D = list(map(int,input().split()))
import fractions
E = C * D // fractions.gcd(C,D)
total = B - B // C - B // D + B // E
F = A-1
total -= F - F // C - F // D + F // E
print(total)
import numpy as np
a,b = map(int,input().split())
print(np.lcm(a, b))

### FIXED CODE ###

import fractions
a,b = map(int,input().split())
print(int(a * b / fractions.gcd(a, b)))
x=int(input())
if x == 1:
  print('Hello World')
elif x == 2:
  a,b=map(int,input().split())
  print(int(a+b))


### FIXED CODE ###

x=int(input())
if x == 1:
  print('Hello World')
else:
  a=int(input())
  b=int(input())
  print(a+b)
from math import factorial as f
n, k = (int(i) for i in input().split())
for i in range(1,k+1):
  if n-k+1 < i:
    print("0")
  else:
    u1 = f(n-k+1) / (f(n-k+1-i) * f(i))
    u2 = f(k-1) / (f(k-i) * f(i-1))
    ans = (u1 * u2) % (10**9 + 7)
    print(int(ans))

### FIXED CODE ###

n, k = (int(i) for i in input().split())
mod = 10**9 + 7
c = [[1], [1,1]]
for i in range(2,n+10):
    c.append([1] + [(c[i-1][j-1] + c[i-1][j]) % mod for j in range(1,i)] + [1])

for i in range(1, k + 1):
    if n - k + 1 < i or k < i:
        print("0")
    else:
        step1 = c[n-k+1][i]
        step2 = c[k-1][i-1]
        ans = (step1 * step2) % mod
        print(int(ans))
a,b = map(int, input().split())

if a<=5:
    ans = 0
elif 6<=a and a<=12:
    ans = b/2
else:
    ans = b

print((int)ans)




### FIXED CODE ###


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

if a<=5:
    ans = 0
elif 6<=a and a<=12:
    ans = b/2
else:
    ans = b

print(int(ans))
#(a*x)をmで割った余りが1になるようなxを求める
#aで割ったときの余りはa^(-1)をかけた余りと同じ
#逆元a^(-1)を求める
#aとmが互いに素であることが条件

def gyakugen( a, m ):
  b = m
  x, y = 1, 0
  while b>0:
    q = a // b
    a, b = b, a-q*b
    x, y = y, x-q*y
  return x if x>0 else x+m


#(a/b)をmで割った余りを求める
#b^(-1)にaを掛けたものをmで割ればよい

def div_remainder(a,b,m):
    b_inv=gyakugen(b,m)
    a%=m
    return (a*b_inv)%m


#(a*b)をmで割った余りを求める

def multi_remainder(a,b,m):
    a%=m
    b%=m
    return (a*b)%m



#nPrをmで割った余りを求める(ただしn<m、mは素数)

def perm_remainder(n,r,m):
    if r>=1:
        return (perm_remainder(n-1,r-1,m)*n)%m
    else:
        return 1

#nCrをmで割った余りを求める(ただしn<m,mは素数)

def comb_remainder(n,r,m):
    r=min(r,n-r)
    return (perm_remainder(n,r,m)*gyakugen(perm_remainder(r,r,m),m))%m


x,y=map(int,input().split())
m=10**9+7
if (2*x-y)%3!=0 or (-x+2*y)%3!=0 or 2*x-y<0 or -x+2*y<0:
  ans=0
else:
  nx=(2*x-y)//3
  n=(x+y)//3
  ans=comb_remainder(n,nx,m)
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
#(a*x)をmで割った余りが1になるようなxを求める
#aで割ったときの余りはa^(-1)をかけた余りと同じ
#逆元a^(-1)を求める
#aとmが互いに素であることが条件

def gyakugen( a, m ):
  b = m
  x, y = 1, 0
  while b>0:
    q = a // b
    a, b = b, a-q*b
    x, y = y, x-q*y
  return x if x>0 else x+m


#(a/b)をmで割った余りを求める
#b^(-1)にaを掛けたものをmで割ればよい

def div_remainder(a,b,m):
    b_inv=gyakugen(b,m)
    a%=m
    return (a*b_inv)%m


#(a*b)をmで割った余りを求める

def multi_remainder(a,b,m):
    a%=m
    b%=m
    return (a*b)%m



#nPrをmで割った余りを求める(ただしn<m、mは素数)

def perm_remainder(n,r,m):
    if r>1:
      return (perm_remainder(n-1,r-1,m)*n)%m
    elif r==1:
      return n
    else:
      return 1

#nCrをmで割った余りを求める(ただしn<m,mは素数)

def comb_remainder(n,r,m):
    r=min(r,n-r)
    return (perm_remainder(n,r,m)*gyakugen(perm_remainder(r,r,m),m))%m


x,y=map(int,input().split())
m=10**9+7
if (2*x-y)%3!=0 or (-x+2*y)%3!=0 or 2*x-y<0 or -x+2*y<0:
  ans=0
else:
  nx=(2*x-y)//3
  n=(x+y)//3
  ans=comb_remainder(n,nx,m)
print(ans)
from functools import reduce
from operator import mul
from collections import Counter

def prod(arr):
    return reduce(mul, arr, 1)

def fancy(arr, index):
    output = []
    for i, v in enumerate(index):
        if v:
            output.append(arr[i])
    return output

def prime_factorize(n):
    answers = []
    while n % 2 == 0:
        answers.append(2)
        n //= 2
    f = 3
    while f**2 <= n:  # instead of f <= n**0.5
        if n % f == 0:
            answers.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        answers.append(n)
    return answers

N = int(input())
factors = prime_factorize(N)
counter = Counter(factors)
odd_factors = [factor for factor in factors if counter[factor]%2!=0]
even_factors = [factor for factor in factors if counter[factor]%2==0]

if odd_factors:
    N_odd = prod(odd_factors)
    selectors = [list(map(bool, map(int, list("{0:b}".format(i).zfill(len(odd_factors)))))) for i in range(1, 2**len(odd_factors))]
    even_coeff = prod(even_factors[::2]) if even_coeff else 1
    combinations = [(prod(fancy(factors, selector))*even_coeff, even_coeff*N_odd//prod(fancy(factors, selector))) for selector in selectors]
    
else:
    combinations = [(int(N**0.5), int(N**0.5))]
distances = [combination[0]-1 + combination[1]-1 for combination in combinations]
print(min(distances))


### FIXED CODE ###

N = int(input())
minstep = 9999999999999999999999999999999
for i in range(1, int(N**0.5+1)):
  if N%i == 0:
    minstep = min(minstep, i+N//i-2)
print(minstep)
#dfs
import sys
sys.setrecursionlimit(10 ** 7)

#dfs
M = int(input())
L = []
for i in range(M):
    d, c = map(int, input().split())
    L.extend([d] * c)

answer = 100

def dfs(count, l):
    global answer
    if len(l) == 1:
        #print(count)
        answer = min(answer, count)
    else:
        for i in range(len(l)-1):
            sum = l[i] + l[i+1]
            result = l[:i] + [int(x) for x in list(str(sum))] + l[i+2:]
            #print(result)
            dfs(count+1, result)

dfs(0, L)
print(answer)


### FIXED CODE ###

import sys
import numpy as np

stdin = sys.stdin
 
ni = lambda:int(ns())
na = lambda:list(map(int,stdin.readline().split()))
ns = lambda:stdin.readline().rstrip()  # ignore trailing spaces

M = ni()
D = [] ; C = []

for i in range(M):
    d, c = na()
    D.append(d)
    C.append(c)

D = np.array(D) ; C = np.array(C)
#桁数の9倍とそれぞれの数字の総和をx
x = C.sum() * 9 + (C * D).sum()
# 18以下で終了
answer = (x + 8) // 9 - 2
print(answer)