Harryxun/stf_run huggingface dataset:
a = int(input())

if a == 105:
    print(1)
elif a <= 104:
    print(0)
else:
    cnt = 0
    divs = 0
    for i in range(1,a+1, 2):
        divs = 0
        for j in range(1,i+1):
            if i%j == 0:
                divs += 1
        if divs == 8:
            cnt += 1

print(cnt)


### FIXED CODE ###

a = int(input())

if a == 105:
    cnt = 1
elif a <= 104:
    cnt = 0
else:
    cnt = 0
    divs = 0
    for i in range(1,a+1, 2):
        divs = 0
        for j in range(1,i+1):
            if i%j == 0:
                divs += 1
        if divs == 8:
            cnt += 1

print(cnt)
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
dp = [0] * (N+1)
mod = 10**9 + 7

for i in range(M):
    dp[a[i]] = -1

dp[0] = 1
if dp[1] != -1 and dp[2] != -1:
    dp[1] = 1
    dp[2] = dp[0] + dp[1]
elif dp[1] == -1 and dp[2] != -1:
    dp[2] = 1
elif dp[1] != -1 and dp[2] == -1:
    dp[1] = 1
else:
    print(0)
    exit()

for i in range(3, N+1):
    if dp[i] == -1:
        continue
    elif dp[i-1] == -1 and dp[i-2] != -1:
        dp[i] = dp[i-2]
    elif dp[i-1] != -1 and dp[i-2] == -1:
        dp[i] = dp[i-1]
    elif dp[i-1] != -1 and dp[i-2] != -1:
        dp[i] = dp[i-1] + dp[i-2]
    else:
        print(0)
        exit()

print(dp[N] % mod)

### FIXED CODE ###

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
dp = [0] * (N+1)
mod = 10**9 + 7

for i in range(M):
    dp[a[i]] = -1

if N == 1:
    print(1)
elif N == 2:
    if dp[1] == -1:
        print(1)
    else:
        print(2)
else:
    dp[0] = 1
    if dp[1] != -1 and dp[2] != -1:
        dp[1] = 1
        dp[2] = dp[0] + dp[1]
    elif dp[1] == -1 and dp[2] != -1:
        dp[2] = 1
    elif dp[1] != -1 and dp[2] == -1:
        dp[1] = 1
    else:
        print(0)
        exit()
    
    
    for i in range(3, N+1):
        if dp[i] == -1:
            continue
        elif dp[i-1] == -1 and dp[i-2] != -1:
            dp[i] = dp[i-2]
        elif dp[i-1] != -1 and dp[i-2] == -1:
            dp[i] = dp[i-1]
        elif dp[i-1] != -1 and dp[i-2] != -1:
            dp[i] = dp[i-1] + dp[i-2]
        else:
            print(0)
            exit()
    
    print(dp[N] % mod)
alice = int(input())
bob = int(input())

if(alice == bob):
    print("Draw")
elif(alice == 1 and bob == 1):
    print("Draw")
    
elif(alice == 1):
    print("Alice")
elif(bob == 1):
    print("Bob")
elif(alice < bob):
    print("Bob")
elif(alice > bob):
    print("Alice")

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Spyderエディタ

これは一時的なスクリプトファイルです
"""
alice = input().split()
alice[0] = int(alice[0])
alice[1] = int(alice[1])
if(alice[0] == alice[1]):
    print("Draw")
elif(alice[0] == 1):
    print("Alice")
elif(alice[1] == 1):
    print("Bob")
elif(alice[0] < alice[1]):
    print("Bob")
elif(alice[0] > alice[1]):
    print("Alice")
w,h,x,y=map(int,input().split())
ans=w*h/2
if w=2*x and h=2*y:
    print(ans,1)
else:
    print(ans,0)


### FIXED CODE ###

w,h,x,y=map(int,input().split())
ans=[w*h/2]
if (x==0 and y==0) or (x==0 and y==h) or (x==w and y==0) or (x==w and y==h):
    ans.append(0)
elif y*w==x*h or y*h==x*w:
    ans.append(1)
else:ans.append(0)
print(*ans)
n, a, b = map(int, input().split())

def degitalsum(i):
  s = str(i)
  array = list(s)
  return sum(array)

ans = 0

for i in range(1, n + 1):
  if a <= degitalsum(i) <= b:
    ans += i

print(ans)  

### FIXED CODE ###

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

def degitalsum(i):
  s = str(i)
  array = list(map(int, s))
  return sum(array)

ans = 0

for i in range(1, n + 1):
  if a <= degitalsum(i) <= b:
    ans += i

print(ans)
N = int(input())
a = list(map(int,input().split()))

color = [0]*9

for rate in a:
    if rate >= 3200:
        color[8] += 1
    else:
        color[rate//400] += 1
    
ans = 0

for i in range(8):
        if color[i] > 0:
            ans += 1
    print(max(ans,1),ans + c[8])

### FIXED CODE ###

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

color = [0]*9

for rate in a:
    if rate >= 3200:
        color[8] += 1
    else:
        color[rate//400] += 1
    
ans = 0

for i in range(8):
        if color[i] > 0:
            ans += 1
print(max(ans,1),ans + color[8])
list1 = [int(i) for i in input().split()]
print("{0:d} {1:d}".format(list[0],list[1]))

### FIXED CODE ###

item = [int(i) for i in input().split()]
print(item[0]*item[1],2*(item[0]+item[1]))
N = int(input(N))
N = N % 10
if N in 2, 4, 5, 7, 9:
    print('hon')

elif N in 0, 1, 6, 8:
    print('pon')

else:
    print('bon')

### FIXED CODE ###

N = int(input())
N = N % 10
if N in [2, 4, 5, 7, 9]:
    print('hon')

elif N in [0, 1, 6, 8]:
    print('pon')

else:
    print('bon')
r, d, x = map(int, input().split())
for i in range(10):
	x = r * x - d
    print(x)

### FIXED CODE ###

r, d, x = map(int, input().split())
for i in range(10):
    x = r * x - d
    print(x)
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=[]
R=a.pop()
L=a.pop(0)
s=L
if not a:
    while a[-1]>0:
        r=a.pop()
        ans.append([s,r])
        s=s-r
        if not a:break
ans.append([R,s])
s=R-s
while a:
    L=a.pop()
    ans.append([s,L])
    s=s-L
print(s)
for x in ans:
    print(*x)


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=[]
R=a.pop()
L=a.pop(0)
s=L
if a:
    while a[-1]>0:
        r=a.pop()
        ans.append([s,r])
        s=s-r
        if not a:break
ans.append([R,s])
s=R-s
while a:
    L=a.pop()
    ans.append([s,L])
    s=s-L
print(s)
for x in ans:
    print(*x)
n = int(input())
AllList = list(map(int, input().split()))
OddList = [0 for i in range(100001)]
EvenList = [0 for i in range(100001)]
for i in range(n):
    if i % 2 == 0:
        OddList[AllList[i]] += 1
    else:
        EvenList[AllList[i]] += 1

OddMax = max(OddList)
EvenMax = max(EvenList)
OddMaxNum = OddList.index(OddMax)
EvenMaxNum = EvenList.index(EvenMax)

if OddMaxNum == EvenMaxNum:
    if OddMax > EvenMax:
        EvenList[EvenMaxNum] = 0
    else:
        OddList[OddMaxNum] = 0

OddMax = max(OddList)
EvenMax = max(EvenList)

ans = n - OddMax - EvenMax

print(ans)



### FIXED CODE ###

instr = input()
ans = ""
for c in instr:
    if c == '1':
        ans += '9'
    elif c == '9':
        ans += '1'
    else:
        ans += c
print(ans)
S = str(input())
s_len = len(S)
ans = [0 for _ in range(s_len)]

def L_checker(n):
    if n+1 == s_len:
        return s_len
    for i in range(n+1,s_len):
        if S[i]=='R':
            return i
    return s_len


def check1(n, r_count):
    if S[n]=='R':
        check1(n+1, r_count+1)
    else:
        next_r = L_checker(n)
        total = r_count+next_r-n
        if total%2==0:
            ans[n-1]=int(total/2)
            ans[n]=int(total/2)
        elif r_count%2==1:
            ans[n-1]=int(total//2)+1
            ans[n]=int(total//2)
        else:
            ans[n-1]=int(total//2)
            ans[n]=int(total//2)+1
        if next_r == s_len:
            print(*ans)
        else:
            check1(next_r,0)

check1(0,0)

### FIXED CODE ###

S = str(input())
s_len = len(S)
ans = [0 for _ in range(s_len)]
r_count = 0
l_count = 0
before = 0
switch = 'R'


for i in range(s_len):
    if S[i]==switch:
        if switch == 'R':
            r_count += 1
        else:
            l_count += 1
    else:
        if switch == 'L':
            switch = 'R'
            if (r_count+l_count)%2 == 0:
                ans[before] = (r_count+l_count)//2
                ans[before-1] = (r_count+l_count)//2
            elif r_count%2 == 0:
                ans[before] = (r_count+l_count)//2+1
                ans[before-1] = (r_count+l_count)//2
            else:
                ans[before] = (r_count+l_count)//2
                ans[before-1] = (r_count+l_count)//2+1
            r_count = 1
            l_count = 0
        else:
            switch = 'L'
            before = i
            l_count = 1


if (r_count+l_count)%2 == 0:
    ans[before] = (r_count+l_count)//2
    ans[before-1] = (r_count+l_count)//2
elif r_count%2 == 0:
    ans[before] = (r_count+l_count)//2+1
    ans[before-1] = (r_count+l_count)//2
else:
    ans[before] = (r_count+l_count)//2
    ans[before-1] = (r_count+l_count)//2+1

print(*ans)
N, Q = map(int, input().split())
 
AB = [[int(x) for x in input().split()] for _ in range(N-1)] 
PX = [[int(x) for x in input().split()] for _ in range(Q)] 
 
graph = [[] for _ in range(N+1)]
for a, b in AB:
    graph[a].append(b)
    graph[b].append(a)
 
value = [0] * (N+1)
for p, x in PX:
    value[p] +=x
 
def dfs(v, parent, add):
    value[v] += add
    for x in graph[v]:
        if x == parent:
            continue
        dfs(x, v, value[v])
 
dfs(1, 0, 0)
ans = ' '.join(map(str,value[1:]))
print(ans)

### FIXED CODE ###

n = int(input())
s = input()

if n >= 3200:
    print(s)
else:
    print("red")
def judgement(s,c,n,m):
    for i in range(m):
        for j in range(m):
            if (s[i]==s[j] and c[i]!=c[j]) or (s[i]==1 and c[i]==0):
                return False
    return True

def num(m,n,c,s,x):
    for i in range(n):
        for j in range(m):
            if s[i]-1==j:
                x[j]=c[i]
                #print(m,n,c,s,x)
    #print(m,n,c,s,x)
    x="".join(map(str,x))
    print(x)

n,m=list(map(int,input().split()))
s=[0]*m
c=[0]*m
x=[0]*n
for i in range(m):
    a=list(map(int,input().split()))
    s[i]=a[0]
    c[i]=a[1]
for i in range(n):
    x[i]=0

r=judgement(s,c,n,m)
if (r==True):
    num(m,n,c,s,x)
else:
    print(-1)

### FIXED CODE ###

N, M = (int(x) for x in input().split())

A = [list(map(int, input().split())) for i in range(M)]

X = ['0' for i in range(N)]#0で埋めつくす
X[0] = '1'
for i in A:
    X[i[0] - 1] = str(i[1])#条件関係なしに代入
    #print(X)

F = 1
for i in A:
    if N > 1 and i[0] == 1 and i[1] == 0:#条件から逸脱する条件
        F = 0
    for j in A:
        #print(j)
        if i[0] == j[0] and i[1] != j[1]:
            F = 0
            
if N == 1 and M == 0:
    print(0)
elif F == 1:
    print(''.join(X))
else:
    print(-1)
N,R = input()

N = int(N)
R = int(R)

if N >= 10:
    print(R)
else:
    print(100*(10-N))

### FIXED CODE ###

N,R = input().split()

N = int(N)
R = int(R)

if N >= 10:
    print(R)
else:
    print(R + 100*(10-N))
K,S = map(int, input().split())

count = 0
for i in range(K+1):
  for j in range(K+1):
    for k in range(K+1):
      if i + J + K == S:
        count += 1

print(count)

### FIXED CODE ###

K,S = map(int, input().split())

count = 0
for i in range(K+1):
  for j in range(K+1):
    if  0 <= S - i - j <= K:
      count += 1
print(count)
sum = a + b
sumto = sum % 2
if sumto = 1:
  response = 'Odd'
else:
  response = 'Even'
return response

### FIXED CODE ###

a, b = map(int, input().split())
seki = a * b
sekito = seki % 2
if sekito == 1:
  response = 'Odd'
else :
  response = 'Even'
print(response)
N = int(input())

for i in range(2, N):
    if N%i == 0:
        a = i
        b = N//i
        if a <= 9 and b <= 9:
            break

if N == 1:
    print("Yes")
elif a <= 9 and b <= 9:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = int(input())

for i in range(2, N+1):
    if N%i == 0:
        a = i
        b = N//i
        if a <= 9 and b <= 9:
            break

if N <= 2:
    print("Yes")
elif a <= 9 and b <= 9:
    print("Yes")
else:
    print("No")
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input())
print(l[k])

### FIXED CODE ###

l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input())
print(l[k - 1])
n=int(input())
l=map(int,input().split())
sort(l)
s=l[0]
for i in range(1,n):
  s+=l[i]
  s/=2
print(s)

### FIXED CODE ###

t=int(input())
l=sorted(map(int, input().split()))
s=l[0]
for i in range(1,t):
  
  s+=l[i]
  s/=2
print(s)
from collections import Counter

n = int(input())
xs = [int(c) for c in input().split()]

mod = (10 ** 9) + 7

c = Counter(xs)

for k, v in c.items():
    if v == 2:
        dup = k

dup_idx = [i for i, v in enumerate(xs) if v == dup]

facts = [1]
for i in range(1, n + 3):
    facts.append(facts[-1] * i % mod)

def inv(x):
    return pow(x, mod - 2, mod)

def comb(p, q):
    if (not 0 <= q <= p) or p < 0:
        return 0
    return facts[p] * inv(facts[q]) % mod * inv(facts[p - q]) % mod

tl = n + 1
for l in range(1, n + 2):
    use_no = comb(tl - 2, l)
    use_both = comb(tl - 2, l - 2)
    use_one = comb(tl - 2, l - 1) * 2 - comb(min(dup_idx) + (tl - 1 - max(dup_idx)), l - 1)
    print((use_no + use_both + use_one) % mod)
    # print(use_no,use_both ,use_one)

### FIXED CODE ###

n = input()
xs = [int(c) for c in input().split()]

p = xs[::2]
q = xs[1::2]

if len(xs) & 1:
    a = list(reversed(p)) + q
else:
    a = list(reversed(q)) + p

print(' '.join(map(str, a)))
import math
x , y = map(int,input().split())
flag = False
MOD = 10**9 + 7
for s in range(max(x,y)):
    if 2 * x - 3 * s == y:
        flag = True
        break
t = x - 2 * s
if flag:
    print(math.factorial(t+s)//(math.factorial(t) * math.factorial(s)) % MOD)
else:
    print(0)

### FIXED CODE ###

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
#出力の制限
#フェルマーの小定理なので、素数のみ使用
mod = 10**9+7 #出力の制限
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
flag = False
x , y = map(int,input().split())
MOD = 10 ** 9 + 7
for s in range(max(x,y)):
    if 2 * x - 3 * s == y:
        flag = True
        break
t = x - 2 * s
if flag:
    print(cmb((t+s),s,mod))
else:
    print(0)
import sys
def input(): return sys.stdin.readline().strip()

def main():
    n,m=map(int,input().split())
    if n == 1:
        print(1)
        return
    aa=[]
    for _ in range(m):
        aa.append(int(input()))
    for i in range(m-1):
        if aa[i]+1==aa[i+1]:
            print(0)
            return
    cc = [0] * n
    i = 0
    j = 2 
    cc[0] = 1
    if aa[0] > 1:
        cc[1] = 1
    else:
        cc[1] = 0
        i += 1
    while j < n:
        if i < m and aa[i] == j:
            i+=1
        else:
            cc[j]=cc[j-1]+cc[j-2]
        j+=1
    print((cc[n-1]+cc[n-2])%1000000007)

main()

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()

def main():
    n,m=map(int,input().split())
    if n == 1:
        print(1)
        return
    aa=[]
    for _ in range(m):
        aa.append(int(input()))
    for i in range(m-1):
        if aa[i]+1==aa[i+1]:
            print(0)
            return
    cc = [0] * n
    i = 0
    j = 2 
    cc[0] = 1
    if m < 1 or aa[0] > 1:
        cc[1] = 1
    else:
        cc[1] = 0
        i += 1
    while j < n:
        if i < m and aa[i] == j:
            i+=1
        else:
            cc[j]=cc[j-1]+cc[j-2]
        j+=1
    print((cc[n-1]+cc[n-2])%1000000007)

main()
N,K = map(int,input().split(" "))
array = list(map(int,input().split(" ")))

minus = 0
while array[minus] < 0 and minus < N:
    minus += 1

first,last = max(minus-K,0),min(minus,N-K)

ans = 2(array[N-1]- array[0])

for i in range(first,last+1):
    m_dist, p_dist = array[i], array[K-1+i]
    if m_dist*p_dist <=0:
        dist_i = min(abs(m_dist),abs(p_dist))*2+max(abs(m_dist),p_dist)
    else:
        dist_i = max(abs(m_dist),abs(p_dist))
    ans = min(ans,dist_i)

print(ans)

### FIXED CODE ###

N,K = map(int,input().split(" "))
array = list(map(int,input().split(" ")))

minus = 0
while minus < N and array[minus]<0:
    minus += 1

first,last = max(minus-K,0),min(minus,N-K)

ans = 2*(array[N-1]- array[0])

for i in range(first,last+1):
    m_dist, p_dist = array[i], array[K-1+i]
    if m_dist*p_dist <=0:
        dist_i = min(abs(m_dist),abs(p_dist))*2+max(abs(m_dist),p_dist)
    else:
        dist_i = max(abs(m_dist),abs(p_dist))
    ans = min(ans,dist_i)

print(ans)
a = int(input())
b= int(input())
c = int(input())
x= int(input())
ans=0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i*500+j*100+k*50==x:
        ans+=1
print(ans)

### FIXED CODE ###

A,B,T=map(int, input().split())
print(T//A*B)
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    n,m = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort()
    while 1:
        a[-1] = a[-1] / 2
        m -= 1
        if m==0:
            res = 0
            for j in a:
                res += int(i)
            print(res)
            exit()
        p = bisect_right(a, a[-1])
        for i in range(p, n-1):
            a[i] = a[i] / 2
            m -= 1
            if m==0:
                res = 0
                for j in a:
                    res += int(i)
                print(res)
                exit()
        a.sort()



if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    n,m = map(int, input().split())
    a = list(map(int, input().split()))
    for i in range(n):
        a[i] = -a[i]
    heapify(a)
    for _ in range(m):
        b = heappop(a)
        b = -(-b // 2)
        heappush(a, b)
    print(-sum(a))




if __name__ == '__main__':
    main()
X, A = (int(_) for _ in input().split())
if x >= A:
      print(10)
else:
      print(0)

### FIXED CODE ###

X, A = (int(_) for _ in input().split())
if X >= A:
      print(10)
else:
      print(0)
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def main():
  N, M = map(int, input().split())
  if N == 1 and M == 1:
    print(0)
  elif N == 1:
    print(combinations_count(M, 2))
  elif M == 1:
    print(combinations_count(N, 2))
  else:
    print(combinations_count(N, 2) + combinations_count(M, 2))
if __name__ == '__main__':
  	main()

### FIXED CODE ###

import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def main():
  N, M = map(int, input().split())
  if N == 1 and M == 1:
    print(0)
  elif N == 0 or N == 1:
    print(combinations_count(M, 2))
  elif M == 0 or M == 1:
    print(combinations_count(N, 2))
  else:
    print(combinations_count(N, 2) + combinations_count(M, 2))
if __name__ == '__main__':
  	main()
n = int(input())
s, t = input().split()

ans = str()
for i in range(n):
    ans += s[i]
    ans += t[i]

print(ans)

### FIXED CODE ###

a = int(input())
b = int(input())

print(6-a-b)
N, K = map(int, input().split())

a = abs(N - K)
ans1 = N % a
b = abs((N % a) - a)
ans2 = N % b

print(min(ans1, ans2))



### FIXED CODE ###

N, K = map(int, input().split())
tmp = N % K
print(min(tmp, abs(tmp - K)))
H,W = map(int,input().split())
s = [input() for i in range(H)]
dx=[0,-1,1,0]
dy=[1,0,0,-1]
flag = True
for i in range(W):
    for j in range(H):
        if s[i][j]=='#':
            cnt = 0
            for k in range(4):
                if 0<=j+dx[k] and j+dx[k]<H and 0<=i+dy[k] and i+dy[k]<W:
                    if s[i+dy[k]][j+dx[k]]=='#':
                        cnt += 1
            if cnt==0:
                flag=False
print('Yes' if flag else 'No')



### FIXED CODE ###

H,W = map(int,input().split())
s = [input() for i in range(H)]
dx=[0,-1,1,0]
dy=[1,0,0,-1]
flag = True
for i in range(H):
    for j in range(W):
        if s[i][j]=='#':
            cnt = 0
            for k in range(4):
                if 0<=j+dx[k] and j+dx[k]<W and 0<=i+dy[k] and i+dy[k]<H:
                    if s[i+dy[k]][j+dx[k]]=='#':
                        cnt += 1
            if cnt==0:
                flag=False
print('Yes' if flag else 'No')
import sys
X, Y = map(int, input().split())

MOD = 1000000007
if (2*X-Y)%3!=0 or (2*X-Y)<0:
    print(0)
    sys.exit()

A = int((2*X-Y)/3)
B = int(Y-2*A)

if A>B:

ans = 1
inv = 1
for i in range(B):
    ans = ans * (A+B-i) %MOD
    inv = inv * (i+1) %MOD

ans = ans * pow(inv, MOD-2, MOD) %MOD
print(ans)


### FIXED CODE ###

import sys
X, Y = map(int, input().split())

MOD = 1000000007
if (2*X-Y)%3!=0:
    print(0)
    sys.exit()

A = int((2*X-Y)/3)
B = int(X-2*A)

if A<0 or B<0:
    print(0)
    sys.exit()

ans = 1
inv = 1
for i in range(B):
    ans = ans * (A+B-i) %MOD
    inv = inv * (i+1) %MOD

ans = ans * pow(inv, MOD-2, MOD) %MOD
print(ans)
10 3
3 6
5 7
6 9

### FIXED CODE ###

n, m = map(int,input().split())

lefts = [0] * m
rights = [0] * m

for i in range(m):
	l, r = map(int,input().split())
	lefts[i] = l
	rights[i] = r

lefts_max = max(lefts)
rights_min = min(rights)

result = rights_min - lefts_max + 1

print(max(result,0))
S = input()

N = len(S)
judge = "R"
Key = []
k = 0

for i in range(N):
    if judge == "R":
        if S[i] == "R":
            k += 1
            continue
        else:
            judge = "L"
            Key.append(k)
            k = 1
            continue
    elif judge == "L":
        if S[i] == "L":
            k += 1
            continue
        else:
            judge = "R"
            Key.append(k)
            k = 1
            continue
Key.append(k)
print(Key)

L = len(Key)
L = L // 2

for i in range(L-1):
    i = 2 * i
    j = 2 * i + 1
    s1 = Key[i]
    s2 = Key[j]
    B = s1 + s2
    ans1 = B//2
    ans2 = B-ans1
    if B%2 == 0:
        s1,s2 = ans1,ans1
    elif s1%2 == 0:
        s1,s2 = ans1,ans2
    else:
        s1,s2 = ans2,ans1

    
    for a in range(B):
        if a == s1 -1:
            print(s1, end=" ")
        elif a == s1:
            print(s2, end=" ")
        else:
            print(0, end=" ")
    

### FIXED CODE ###

s = input()
key = 1
change = []
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        key += 1
    else:
        change.append(key)
        key = 1
change.append(key)
anslist = []
for i in range(len(change)//2):
    p, q = change[2*i], change[2*i+1]
    for j in range(p-1):
        anslist.append(0)
    t = p+q
    a = t//2
    b = t-a
    if t % 2 == 0:
        anslist.append(a)
        anslist.append(b)
    else:
        if p % 2 == 0:
            anslist.append(a)
            anslist.append(b)
        else:
            anslist.append(b)
            anslist.append(a)  
    for j in range(q-1):
        anslist.append(0)
for i in anslist:
    print(i, end=" ")
n = int(input())

if n == "A":
    print("T")
elif n == "T":
    print("A")
elif n == "C":
    print("G")
else:
    print("C")

### FIXED CODE ###

n = str(input())

if n == "A":
    print("T")
elif n == "T":
    print("A")
elif n == "C":
    print("G")
else:
    print("C")