Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

th, tw = map(int, input().split())
t = [input().strip() for _ in range(th)]
ph, pw = map(int, input().split())

t = [[t[i][j:j + pw] for j in range(tw - pw + 1)] for i in range(th)]
p = [input().strip() for _ in range(ph)]

for i in range(th - ph + 1):
    for j in range(tw - pw + 1):
        for k in range(ph):
            if t[i + k][j] != p[k]:
                break
        else:
            print(i, j)

### FIXED CODE ###

base1 = 127
base2 = 1009
mask = (1 << 32) - 1


def calc_hash(f, r, c):
    global ph, pw, h
    tmp = [[0] * c for _ in range(r)]
    dr, dc = r - ph, c - pw

    t1 = 1
    for _ in range(pw):
        t1 = (t1 * base1) & mask
    for i in range(r):
        e = 0
        for j in range(pw):
            e = e * base1 + f[i][j]
        for j in range(dc):
            tmp[i][j] = e
            e = (e * base1 - t1 * f[i][j] + f[i][j + pw]) & mask
        tmp[i][dc] = e

    t2 = 1
    for _ in range(ph):
        t2 = (t2 * base2) & mask
    for j in range(dc + 1):
        e = 0
        for i in range(ph):
            e = e * base2 + tmp[i][j]
        for i in range(dr):
            h[i][j] = e
            e = (e * base2 - t2 * tmp[i][j] + tmp[i + ph][j]) & mask
        h[dr][j] = e


th, tw = map(int, input().split())
t = [[ord(c) for c in input().strip()] for _ in range(th)]
ph, pw = map(int, input().split())
p = [[ord(c) for c in input().strip()] for _ in range(ph)]

if th >= ph and tw >= pw:
    h = [[0] * tw for _ in range(th)]
    calc_hash(p, ph, pw)
    key = h[0][0] & mask
    calc_hash(t, th, tw)
    for i in range(th - ph + 1):
        for j in range(tw - pw + 1):
            if h[i][j] & mask == key:
                print(i, j)
### BUGGY CODE ###

a=str(input())
count=0
while 1:
    before=a
    if "01" in a:
        a=a.replace("01","",1)
        count+=2
    if "10" in a:
        a=a.replace("10","",1)
        count+=2
    after=a
    if before==after:
        break
print(count)


### FIXED CODE ###

a=list(input())
min_count=2*min(a.count("0"),a.count("1"))
print(min_count)
### BUGGY CODE ###

N,M = input().split(" ")
N,M=int(N),int(M)
S=[input() for i in range(M)]

for i in range(M):
  if S[i][0] == '1':
    for n in range(M):
      if S[n][0] =='1':
        pass
      elif S[i][2] == S[n][0] and S[n][2] == str(N):
        print('POSSIBLE')
        exit()
        
print('IMPOSSIBLE')

### FIXED CODE ###

N, M = map(int, input().split())
from_1 = [False]*N
to_N = [False]*N
for _ in range(M):
    a, b = map(int, input().split())
    if a == 1:
        from_1[b-1] = True
    elif b == N:
        to_N[a-1] = True
for i in range(1, N):
    if from_1[i] and to_N[i]:
        print('POSSIBLE')
        break
else:
    print('IMPOSSIBLE')
### BUGGY CODE ###

a,op,b=input().split()

while True:
    if op == "?":
        break
    else:
        if op == "+":
            print(int(a)+int(b))
        elif op == "-":
            print(int(a)-ing(b))
        elif op == "*":
            print(int(a)*int(b))
        elif op == "/":
            Print (int (a) //int (b))
        else:
            print("error")

### FIXED CODE ###

while True:
    a, op, b = input().split()
    if op == '?':
        break
    if op == '/':
        op = '//'
    print(eval(a + op + b))
### BUGGY CODE ###

n=int(input())

L=[[] for i in range(n+1)]

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

fe=[0 for i in range(n+1)]
que=[(1,0)]
visited=[0 for i in range(n+1)]
visited[1]=1
head=0

while len(que)>head:
    now=que[head]
    head+=1
    fe[now[0]]=now[1]
    for nex in L[now[0]]:
        if visited[nex]==0:
            visited[nex]=1
            que.append((nex,now[1]+1))
            
sn=[0 for i in range(n+1)]
que=[(n,0)]
visited=[0 for i in range(n+1)]
visited[-1]=1
head=0

while len(que)>head:
    now=que[head]
    head+=1
    sn[now[0]]=now[1]
    for nex in L[now[0]]:
        if visited[nex]==0:
            visited[nex]=1
            que.append((nex,now[1]+1))

kaname=[]
for i in range(1,n+1):
    ck=fe[i]-sn[i]
    if ck==1 or ck==2:
        kaname.append(i)

cnt=0
que=[(1,0)]
visited=[0 for i in range(n+1)]
visited[1]=1
head=0

while len(que)>head:
    now=que[head]
    head+=1
    cnt+=1
    for nex in L[now[0]]:
        if visited[nex]==0 and not nex in kaname:
            visited[nex]=1
            que.append((nex,now[1]+1))

if cnt*2>n:
    print("Fennec")
else:
    print("Snuke")

### FIXED CODE ###

n=int(input())

L=[[] for i in range(n+1)]

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

fe=[0 for i in range(n+1)]
que=[(1,0)]
visited=[0 for i in range(n+1)]
visited[1]=1
head=0

while len(que)>head:
    now=que[head]
    head+=1
    fe[now[0]]=now[1]
    for nex in L[now[0]]:
        if visited[nex]==0:
            visited[nex]=1
            que.append((nex,now[1]+1))
            
sn=[0 for i in range(n+1)]
que=[(n,0)]
visited=[0 for i in range(n+1)]
visited[-1]=1
head=0

while len(que)>head:
    now=que[head]
    head+=1
    sn[now[0]]=now[1]
    for nex in L[now[0]]:
        if visited[nex]==0:
            visited[nex]=1
            que.append((nex,now[1]+1))

kaname=[]
for i in range(1,n+1):
    ck=fe[i]-sn[i]
    if ck==1 or ck==2:
        kaname.append(i)

cnt=0
que=[(1,0)]
visited=[0 for i in range(n+1)]
visited[1]=1
head=0

while len(que)>head:
    now=que[head]
    head+=1
    cnt+=1
    for nex in L[now[0]]:
        if visited[nex]==0 and not nex in kaname:
            visited[nex]=1
            que.append((nex,now[1]+1))

if cnt*2>n:
    print("Fennec")
else:
    print("Snuke")
### BUGGY CODE ###

import heapq
n,m=map(int,input().split())
a=sorted(list(map(int, input().split())))
bc=[list(map(int, input().split())) for _ in range(m)]
bc.sort(key=lambda x:x[1])
heapq.heapify(a)
for b,c in bc:
  for j in range(b):
    amin=heapq.heappop(a)
    if amin<c:
      heapq.heappush(a,c)
    else:
      heapq.heappush(a,amin)
      break
print(sum(a))

### FIXED CODE ###

def main():
    import heapq
    n,m=map(int,input().split())
    a=sorted(list(map(int, input().split())))
    bc=[list(map(int, input().split())) for _ in range(m)]
    bc.sort(key=lambda x:-x[1])
    heapq.heapify(a)
    for b,c in bc:
      for j in range(b):
        amin=heapq.heappop(a)
        if amin<c:
          heapq.heappush(a,c)
        else:
          heapq.heappush(a,amin)
          break
    print(sum(a))
main()
### BUGGY CODE ###

from operator import itemgetter

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

a = [0]*(n-1)
b = [0]*(n-1)
for i in range(n-1):
    a[i],b[i] = map(int, input().split())

p = [0]*q
x = [0]*q

for i in range(q):
    p[i],x[i] = map(int, input().split())

a,b = (list(x) for x in zip(*sorted(zip(a, b))))
p,x = (list(y) for y in zip(*sorted(zip(p,x))))


score = [0]*n

def down_tree(parent, add_score, q_start, n_start):
    global score
    for i in range(q_start, q):
        if p[i]-1 == parent:
            add_score += x[i]
        if p[i]-1 >parent:
            q_start = i
            break
    for i in range(n_start, n-1):
        if a[i]-1 == parent:
            down_tree(b[i]-1, add_score, q_start, i)
        if a[i]-1 > parent:
            break

    score[parent] += add_score

    return 0

down_tree(0, 0, 0, 0)

print(*score)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(200005)
n, q = map(int, input().split())

to = [[] for i in range(n+1)]


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

score = [0]*(n+1)
for i in range(q):
    p, x = map(int, input().split())
    score[p] += x


def down_tree(index, parent):
    for i in to[index]:
        if i == parent:
            continue
        score[i] += score[index]
        down_tree(i, index)



down_tree(1, 1)

print(' '.join(map(str, score[1:])))
### BUGGY CODE ###

S=input()
L=len(S)

M=10**9+7

dp=[ [ 0 for i in range(4) ] for k in range(L+1) ]
all=1

abc=0
ab=0
a=0

for i in range(L):
	if S[i]=="A":
		a=( a+all ) %M
	if S[i]=="B":
		ab=( ab+a )%M
	if S[i]=="C":
		abc=( abc+ab )%M

	if S[i]=="?":
		abc=( abc*3+ab )%M
		ab=( ab*3+a)%M
		a=( a*3+all )%M
		all*=3

print (abc%M)


### FIXED CODE ###

S=raw_input()

M=10**9+7

all=1
abc=0
ab=0
a=0

for x in S:
	if x=="A":
		a+=all
	if x=="B":
		ab+=a
	if x=="C":
		abc+=ab

	if x=="?":
		abc=abc*3+ab
		ab=ab*3+a
		a= a*3+all
		all*=3

	abc%=M
	ab%=M
	a%=M
	all%=M


print abc%M
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=0
for aa in set(a):
  ca=a.count(aa)
  if ca>=aa:
    ans+=ca-aa
  else:
    ans+=ca
print(ans)

### FIXED CODE ###

from collections import defaultdict
n=int(input())
a=list(map(int,input().split()))

dd=defaultdict(lambda:0)
for aa in a: dd[aa]+=1

ans=0
for aa in dd.keys():
  ca=dd[aa]
  if ca>=aa:
    ans+=ca-aa
  else:
    ans+=ca
print(ans)
### BUGGY CODE ###

k,s = map(int,input().split())
a = 0
for x in range(k+1):
  for y in range(k+1):
    for z in range(k+1):
      if x+y+z == s:
        a += 1
        
print(a)
      

### FIXED CODE ###

k,s = map(int,input().split())
a = 0
for x in range(k+1):
  for y in range(k+1):
      if s-(x+y) <= k and s-(x+y) >= 0:
        a += 1
        
print(a)
### BUGGY CODE ###

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return {i:0 for i in range(n + 1) if is_prime[i]}

n = int(input())
a = list(map(int,input().split()))
d = primes(max(a))

for i in a:
    for k , v in d.items():
        if i % k == 0:
            d[k] += 1
flag = True  
for v in d.values():
    if v == n:
        print("not coprime")
        exit()
    elif v > 1:
        flag = False
if flag:
    print("pairwise coprime")
else:
    print("setwise coprime")

### FIXED CODE ###

def primes(n):
    is_prime = [-1] * (n + 1)
    is_prime[0] = 0
    is_prime[1] = 1
    for i in range(2, n + 1):
        if is_prime[i] != -1:
            continue
        for j in range(i, n + 1, i):
            if is_prime[j] == -1:
                is_prime[j] = i
    return is_prime

n = int(input())
a = list(map(int,input().split()))
s = primes(max(a))
d = {}
for i in a:
    now = i
    while s[now] != 1:
        t = s[now]
        d[t] = d.get(s[now],0) + 1
        while now % t == 0:
            now //= t
            
                
            
    
flag = True
for v in d.values():
    if v == n:
        print("not coprime")
        exit()
    elif v > 1:
        flag = False

if flag:
    print("pairwise coprime")
else:
    print("setwise coprime")
### BUGGY CODE ###

N,Q=map(int, input().split())
G=[[] for _ in range(N)]
for i in range(N-1):
    a,b=map(int, input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)
X=[0]*N
for i in range(Q):
    p,x=map(int, input().split())
    X[p-1]+=x
que=[(0,-1)]
while que:
    now, pre=que.pop(0)
    for nex in G[now]:
        if nex==pre:
            continue
        else:
            X[nex]+=X[now]
            que.append((nex,now))

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

### FIXED CODE ###

from collections import deque 
N,Q=map(int, input().split())
G=[[] for _ in range(N)]
for i in range(N-1):
    a,b=map(int, input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)
X=[0]*N
for i in range(Q):
    p,x=map(int, input().split())
    X[p-1]+=x
que=deque([(0,-1)])
#print(que)
while que:
    now, pre=que.pop()
    for nex in G[now]:
        if nex==pre:
            continue
        else:
            X[nex]+=X[now]
            que.append((nex,now))

print(" ".join(map(str, X)))
### BUGGY CODE ###

def calc_expected_value(n):
    sum_n = [i for i in range(1, n+1)]
    return sum(sum_n) / n


n, k_range = map(int, input().split())
p = list(map(int, input().split()))
sum_dice_num = 0
ans = 0.0

for i in range(n-k_range+1):
    k_dice_num = sum(p[i:i+k_range])
    if k_dice_num < sum_dice_num:
        continue
    else:
        e = sum([calc_expected_value(p[i+k]) for k in range(k_range)])
        sum_dice_num = k_dice_num
        ans = max(ans, e)

print(ans)

### FIXED CODE ###

def calc_expected_value(n):
    return (n+1) / 2


n, k_range = map(int, input().split())
p = list(map(int, input().split()))
e_list = [0] * n
ans_list = [0] * n
ans = 0.0

for i in range(n):
    e_list[i] = calc_expected_value(p[i])
    if i == k_range-1:
        ans_list[i] = sum([e_list[i-k] for k in range(k_range)])
    else:
        ans_list[i] = ans_list[i-1] + e_list[i] - e_list[i-k_range]

print(max(ans_list))
### BUGGY CODE ###

import sys

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

ans = []
check = []

idx = N
while 0 < idx:
    for i in range(M, -1, -1):
        if idx-i < 0: continue
        if S[idx-i] == '1':
            if idx-i in check: print(-1); sys.exit()
            else: check.append(idx-i)
        else:
            ans.append(i)
            idx -= i
            break

for a in ans[::-1]: print(a)

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    N, M = map(int, input().split())
    S = input()
    
    ans = []
    check = [False] * (N+1)
    
    idx = N
    while 0 < idx:
        f = False
        for i in range(M, 0, -1):
            if idx-i < 0: continue
            if S[idx-i] == '1':
                if check[idx-i]: print(-1); sys.exit()
                else: check[idx-i] = True
            else:
                ans.append(i)
                idx -= i
                f = True
                break
        if not f: print(-1); sys.exit()
    
    for a in ans[::-1]: print(a)
if __name__ == '__main__':
    main()
### BUGGY CODE ###

import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
ans=0
n=int(input())
for i in range(n):
  for j in range(n):
    for k in range(n):
      if i+1==1 or j+1==1 or k+1==1:
        ans += 1
      else:
        ans+=gcd(i+1, j+1, k+1)
print(ans)


### FIXED CODE ###

from math import gcd
n=int(input())
l=[gcd(i+1, gcd(j+1, k+1)) for i in range(n) for j in range(n) for k in range(n)]
print(sum(l))
### BUGGY CODE ###

#!/usr/bin/env python3
import sys
import heapq
from collections import defaultdict


def solve(N: int, M: int, U: "List[int]", V: "List[int]", S: int, T: int):
    S -= 1
    T -= 1
    adj = [[] for i in range(N)]
    for u, v in zip(U, V):
        adj[u-1].append(v-1)
    Q = [(0, S, frozenset([S]))]
    visited = defaultdict(lambda: 0)

    while len(Q) > 0:
        d, u, route = heapq.heappop(Q)
        if u == T:
            visited[route] += 1
        if u == T and d % 3 == 0:
            print(d // 3)
            return
        if u == T and visited[route] >= 3:
            print(-1)
            return
        for v in adj[u]:
            heapq.heappush(Q, (d+1, v, route | {v}))

    print(-1)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    u = [int()] * (M)  # type: "List[int]" 
    v = [int()] * (M)  # type: "List[int]" 
    for i in range(M):
        u[i] = int(next(tokens))
        v[i] = int(next(tokens))
    S = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    solve(N, M, u, v, S, T)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import heapq
from collections import defaultdict


def solve(N: int, M: int, U: "List[int]", V: "List[int]", S: int, T: int):
    S -= 1
    T -= 1
    adj = [[] for i in range(N)]
    for u, v in zip(U, V):
        adj[u-1].append(v-1)
    color = [[0, 0, 0] for i in range(N)]
    color[S][0] = 1
    Q = [(0, S)]

    while len(Q) > 0:
        d, u = heapq.heappop(Q)
        if u == T and d % 3 == 0:
            print(d // 3)
            return
        for v in adj[u]:
            if color[v][(d+1) % 3] == 1:
                continue
            heapq.heappush(Q, (d+1, v))
            color[v][(d+1) % 3] = 1

    print(-1)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    u = [int()] * (M)  # type: "List[int]" 
    v = [int()] * (M)  # type: "List[int]" 
    for i in range(M):
        u[i] = int(next(tokens))
        v[i] = int(next(tokens))
    S = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    solve(N, M, u, v, S, T)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

from collections import deque

def main():
    N, M = list(map(int, input().split()))
    R = [set() for _ in range(N+1)]
    for _ in range(M):
        x = list(map(int, input().split()))
        R[x[0]].add(x[1])
        R[x[1]].add(x[0])
    
    q = deque()
    s = set()
    r = [0] * (N+1)
    q.append(1)
    while any(q):
        x = q.popleft()
        s.add(x)
        ro = R[x]
        for i in ro:
            if i not in s and i not in q:
                if r[i] == 0:
                    r[i] = x
                    q.append(i)
    if len(s) == N:
        print("Yes")
        print("\n".join(map(str, r[2:])))
    else:
        print("No")

if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import deque

def main():
    N, M = list(map(int, input().split()))
    R = [set() for _ in range(N+1)]
    for _ in range(M):
        x = list(map(int, input().split()))
        R[x[0]].add(x[1])
        R[x[1]].add(x[0])
    
    q = deque()
    #s = set()
    r = [0] * (N+1)
    q.append(1)
    while any(q):
        x = q.popleft()
        #s.add(x)
        ro = R[x]
        for i in ro:
            #if r[i] == 0 and i not in s and i not in q:
            if r[i] == 0: 
                r[i] = x
                q.append(i)
    #if len(s) == N:
    print("Yes")
    print("\n".join(map(str, r[2:])))
    #else:
    #    print("No")

if __name__ == '__main__':
    main()
### BUGGY CODE ###

def p(n):
	ans = 0
	v = n
	while True:
		if n % 10:
			v = n
			break
		ans += 1
		n /= 10
	return ans

def vp(n):
	v = n
	while True:
		if n % 10:
			v = n
			break
		n //= 10
	return v

def lcm(x, y):
	if x > y:
		d = p(x)
		z = vp(x)
	else:
		d = p(y)
		z = vp(x)
	x = vp(x)
	y = vp(y)
	ans = 0
	while True:
		if z % x == 0 and z % y == 0:
			ans = z
			break
		z += 1
	return ans * 10**d

def resolve():
	n = int(input())
	T = []
	for _ in range(n):
		T.append(int(input()))
	ans = 1
	for i in range(n):
		ans = lcm(ans, T[i])
	print(ans)
resolve()

### FIXED CODE ###

def gcd(a, b):
	"""Compute the greatest common divisor of a and b"""
	while b > 0:
		a, b = b, a % b
	return a

def lcm(a, b):
	"""Compute the lowest common multiple of a and b"""
	return a * b // gcd(a, b)

def resolve():
	n = int(input())
	T = []
	for _ in range(n):
		T.append(int(input()))
	ans = 1
	for i in range(n):
		ans = lcm(ans, T[i])
	print(int(ans))
resolve()
### BUGGY CODE ###

A,B,K = map(int, input().split())
for i in range(B-A+1):
    if i<K or (B-A-i)<(K):
        print(A+i)

### FIXED CODE ###

A,B,K = map(int, input().split())
X = []
L = B-A+1
if 2*K>=L:
    for i in range(L):
        print(A+i)
else:
    for j in range(K):
        print(A+j)
    for k in range(K):
        print(B-K+1+k)
### BUGGY CODE ###

from operator import itemgetter

n,m,q=map(int,input().split())
l=[]
fa=[m]*n

def check_list(la: list):
    for i in range(len(la)-1):
        if la[i+1]<la[i] or la[i]>m or la[i]<1:
            return False
    
    return True


def dfs(i,a):
    if not check_list(a):
        return -1
    elif i==len(l):
        ret=0
        for i in range(len(a)-1):
            if a[i+1]<a[i] or a[i]>m:
                ret=-1

        for le in l:
            if a[le[1]-1]-a[le[0]-1]==le[2]:
                ret+=le[3]
        return ret
    else:
        c0=a.copy()     # use this (change first)
        c1=a.copy()     # use this (change second)
        c2=a.copy()     # dojn't use this
        c0[l[i][0]-1]=c0[l[i][1]-1]-l[i][2]
        c1[l[i][1]-1]=c1[l[i][0]-1]+l[i][2]
        return max(dfs(i+1,c0),dfs(i+1,c1),dfs(i+1,c2))




for _ in range(q):
    l.append(tuple(map(int,input().split())))


print(dfs(0,fa))

### FIXED CODE ###

import itertools
n,m,q=map(int,input().split())

ql=[]
for _ in range(q):
    ql.append(tuple(map(int,input().split())))

def check(t):
    ret=0
    for q in ql:
        if t[q[1]-1]-t[q[0]-1]==q[2]:
            ret+=q[3]

    return ret

print(max(map(check,itertools.combinations_with_replacement(range(1,m+1),n))))
### BUGGY CODE ###

# https://atcoder.jp/contests/abc156/tasks/abc156_d

import sys
input = sys.stdin.readline


from operator import mul
from functools import reduce

def pow_k(x, n):
    """
    O(log n)
    """
    MOD = 10**9 + 7
    if n == 0:
        return 1

    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
        x *= x
        n //= 2

    return K * x

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    MOD = 10**9 + 7
    over,under  = 1,1
    for i in range(n, n - r, -1):
        over = over*i
    # over = reduce(mul, range(n, n - r, -1))
    for i in range(1, r + 1):
        under = under*i
    return over // under

def main():
    MOD = 10**9 + 7
    n,a,b = [int(i) for i in input().strip().split()]
    _sum = ((pow_k(2, n))-1) % MOD
    cmb_a = cmb(n, a) %MOD
    cmb_b = cmb(n, b) % MOD
    ans = (_sum - cmb_a - cmb_b) % MOD
    
    print(ans)
    

if __name__ == "__main__":
    main()

### FIXED CODE ###

# https://atcoder.jp/contests/abc156/tasks/abc156_d

import sys
input = sys.stdin.readline


from operator import mul
from functools import reduce

def pow_k(x, n, mod):
    """
    O(log n)
    """
    if n == 0:
        return 1

    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
            K %= mod
        x *= x
        x %= mod
        n //= 2

    return (K * x) %mod


def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

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

def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

def main():
    n, a, b = [int(i) for i in input().strip().split()]
    MOD = 10**9 + 7
    _sum = ((pow_k(2, n,MOD))-1) % MOD
    cmb_a = combination(n, a,MOD)
    cmb_b = combination(n, b,MOD)
    ans = (_sum - cmb_a - cmb_b) % MOD
    
    print(ans)

if __name__ == "__main__":
    main()