Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())
ss = [[] for _ in range(N)]

for i in range(M):
    p, y = map(int, input().split())
    ss[p-1].append((i, y))

ls = [''] * M
for j in range(N):
    s = ss[j]
    s.sort(key=lambda g: g[1])
    for d, (i, y) in enumerate(s):
        ps = str(j+1).zfill(6)
        ys = str(d+1).zfill(6)
        ls[i] = f"{ps}{ys}"

for l in ls:
    print(l)


### FIXED CODE ###

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

for i in range(M):
    p, y = map(int, input().split())
    ss[p-1].append((i, y))

ls = [''] * M
for p in range(N):
    s = ss[p]
    s.sort(key=lambda g: g[1])
    for d, (i, y) in enumerate(s):
        ps = str(p+1).zfill(6)
        ds = str(d+1).zfill(6)
        ls[i] = ps+ds

for l in ls:
    print(l)
N,M = tuple(map(int,input().split()))
matchlist = [tuple(map(lambda x:int(x)-1,input().split())) for i in range(M)]
#最大のグループの大きさを出す
friendlist = [0 for i in range(N)]
gplist = [[]]
def match(ab):
    a,b=ab
    gpa=friendlist[a]
    gpb=friendlist[b]
    if bool(gpa) and gpa==gpb:
        return
    elif not bool(gpa) and not bool(gpb):
        friendlist[a]=len(gplist)
        friendlist[b]=len(gplist)
        gplist.append([a,b])
    elif bool(gpa) and not bool(gpb):
        friendlist[b] = gpa
        gplist[gpa].append(b)
    elif not bool(gpa) and bool(gpb):
        friendlist[a] = gpb
        gplist[gpb].append(a)
    else:
        for i in gplist[gpb]:
            friendlist[i] = gpa
        gplist[gpa].extend(gplist[gpb])
        gplist.remove(gplist[gpb])
# print(gplist)
for i in range(M):
    match(matchlist[i])
    # print(gplist)
    # print(friendlist)
print(max([len(item) for item in gplist]))

### FIXED CODE ###

N,M = tuple(map(int,input().split()))
# matchlist = [tuple(map(lambda x:int(x)-1,input().split())) for i in range(M)]
#最大のグループの大きさを出す
friendlist = list(range(N))
# [所属先,[所属メンバー]]
gplist = [[i] for i in range(N)]

def getgroup(a):
    A = friendlist[a]
    if A == a:
        return a
    else:
        return getgroup(A)

def match(ab):
    A = getgroup(ab[0])
    B = getgroup(ab[1])
    if A==B:
        return
    elif len(gplist[A])<len(gplist[B]):
        gplist[B].extend(gplist[A])
        friendlist[A] = B
    else:
        gplist[A].extend(gplist[B])
        friendlist[B] = A

for i in range(M):
    # print(friendlist)
    # print(gplist)
    match(tuple(map(lambda x:int(x)-1,input().split())))

# print(friendlist)
# print(gplist)

print(max([len(item) for item in gplist]))
n=int(input())
xymap=[[-1 for j in range(101)] for i in range(101)]
inp=[]
for i in range(n):
    xi,yi,hi=map(int,input().split())
    
    if hi==0:
        for x in range(101):
            for y in range(101):
                a=abs(xi-x)+abs(yi-y)+hi
                if xymap[x][y]<=a and xymap[x][y]!=-2:
                    pass
                else:
                    xymap=-2
    else:
            
        for x in range(101):
            for y in range(101):
                a=abs(xi-x)+abs(yi-y)+hi
                if xymap[x][y]==a or xymap[x][y]==-1 :
                    xymap[x][y]=a
                else:
                    xymap[x][y]=-2
flag=0
for x in range(101):
    for y in range(101):
        if xymap[x][y]!=-2:
            flag=1
            print(x,y,xymap[x][y])
if flag==0:
    for i in range(len(inp)):
        xi=inp[i][0]
        yi=inp[i][1]
        hi=inp[i][2]
        for x in range(101):
            for y in range(101):
                a=abs(xi-x)+abs(yi-y)+hi
                if xymap[x][y]==a or xymap[x][y]==-1 :
                    xymap[x][y]=a
                else:
                    xymap[x][y]=-2
    for x in range(101):
        for y in range(101):
            if xymap[x][y]!=-2:
                print(x,y,xymap[x][y])


### FIXED CODE ###

n=int(input())
xymap=[[-1 for j in range(101)] for i in range(101)]
inlist=[]
for i in range(n):
    xi,yi,hi=map(int,input().split())
    inlist.append([xi,yi,hi])
inlist.sort(key=lambda x :-x[2])
for i in range(n):
    xi,yi,hi=inlist[i]
    if hi==0:
        xymap[xi][yi]=-2
        for x in range(101):
            for y in range(101):
                a=abs(xi-x)+abs(yi-y)+hi
                if xymap[x][y]<=a:
                    pass
                else:
                    xymap[x][y]=-2
    else:
        for x in range(101):
            for y in range(101):
                a=abs(xi-x)+abs(yi-y)+hi
                if xymap[x][y]==a or xymap[x][y]==-1 :
                    xymap[x][y]=a
                else:
                    xymap[x][y]=-2
for x in range(101):
    for y in range(101):
        if xymap[x][y]!=-2:
            print(x,y,xymap[x][y])
import sys
sys.setrecursionlimit(500000)

N,K = map(int,input().split())
T = [[]*N for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)
visited = [0]*N
ans = 1
def bfs(i,bb,b):
    global ans
    visited[i] = 1
    ans = (ans*(K-bb-b))%(10**9+7)
    cnt = 0
    for j in T[i]:
        if visited[j] == 1:
            continue
        bfs(j,b+cnt,1)
        cnt += 1
bfs(1,0,0)
print(ans)




### FIXED CODE ###

import sys
sys.setrecursionlimit(500000)

N,K = map(int,input().split())
T = [[]*N for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)
visited = [0]*N
ans = 1
def bfs(i,bb,b):
    global ans
    visited[i] = 1
    ans = (ans*(K-bb-b))%(10**9+7)
    cnt = 0
    for j in T[i]:
        if visited[j] == 1:
            continue
        bfs(j,b+cnt,1)
        cnt += 1
bfs(0,0,0)
print(ans)
n=input()
c=0
for i in range(n):
  if n[i]=='o':
    c+=1
if c>0:
  print(700*c)
else:
  print(700)

### FIXED CODE ###

n=input()
c=0
for i in range(len(n)):
  if n[i]=='o':
    c+=1
if c>0:
  print(700+(c*100))
else:
  print(700)
from collections import defaultdict
from collections import deque
# starting with start node and then looking for the kids
# and the solving the sub-problem with kids
def recursive_dfs(graph, start_node, map1):
  if start_node not in graph:
    map1[start_node] = 0
    return 0
  dist = 0
  for child in graph[start_node]:
    if child not in map1:
      dist = max(recursive_dfs(graph, child, map1), dist)
    else:
      dist = max(map1[child], dist)
  map1[start_node] = dist + 1
  #print(map1)
  return (dist + 1)

N,M = [int(i) for i in input().split()] # nodes, edges
graph = defaultdict(list)
for i in range(M):
  s,d = [i for i in input().split()]
  graph[s].append(d)
map1 = defaultdict(int)
ans = 0
for i in range(1, N+1):
  if i in map1:
    ans = max(ans, map1[str(i)])
  else:
    ans = max(recursive_dfs(graph, str(i), map1), ans)
print("%s" % ans)

### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(100000000)
from collections import defaultdict
from collections import deque
# starting with start node and then looking for the kids
# and the solving the sub-problem with kids
def recursive_dfs(graph, start_node, map1):
  if start_node not in graph:
    map1[start_node] = 0
    return 0
  dist = 0
  for child in graph[start_node]:
    if child not in map1:
      dist = max(recursive_dfs(graph, child, map1), dist)
    else:
      dist = max(map1[child], dist)
  map1[start_node] = dist + 1
  #print(map1)
  return (dist + 1)
 
N,M = [int(i) for i in input().split()] # nodes, edges
graph = defaultdict(list)
for i in range(M):
  s,d = [i for i in input().split()]
  graph[s].append(d)
map1 = defaultdict(int)
ans = 0
for i in range(1, N+1):
  if i in map1:
    ans = max(ans, map1[str(i)])
  else:
    ans = max(recursive_dfs(graph, str(i), map1), ans)
print("%s" % ans)
True:
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
        break
        
    for h in range(H):
        for w in range(W):
            if  (h + w) % 2 == 0:
                print('#', end='')
            else:
                print('.', end='')
                
        print()

### FIXED CODE ###

while True:
 
    H,W =[int(i) for i in input().split()]
 
    if H == W == 0:
        break
 
    for h in range(H):
        for w in range(W):
            if (h+w) % 2 ==0:
                print('#', end='')
            else :
                print('.' ,end='')
        print()
    print()
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

beaten_monster_num = 0

for i in range(n):
    if a[i] <= b[i]:
        if a[i+1] >= b[i] - a[i]:
            beaten_monster_num += b[i]
            a[i+1] -= b[i] - a[i]
        else:
            beaten_monster_num += a[i] + a[i+1]
            a[i+1] = 0
    elif a[i] - b[i] <= b[i+1]:
        beaten_monster_num += a[i]
        b[i+1] -= a[i] - b[i]
    else:
        beaten_monster_num += b[i] + b[i+1]
        b[i+1] = 0

print(int(beaten_monster_num))

### FIXED CODE ###

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

beaten_monster_num = 0

for i in range(n):
    if a[i] <= b[i]:
        if a[i+1] >= b[i] - a[i]:
            beaten_monster_num += b[i]
            a[i+1] -= b[i] - a[i]
        else:
            beaten_monster_num += a[i] + a[i+1]
            a[i+1] = 0
    else:
        beaten_monster_num += b[i]

print(int(beaten_monster_num))
A, B, C = map(int, input().split())
if A == B:
  print('C')
elif B == C:
  print('A')
else:
  print('B)

### FIXED CODE ###

A, B, C = map(int, input().split())
if A == B:
  print(C)
elif B == C:
  print(A)
else:
  print(B)
c = [input() for i in range(3)]
print(c[i][i] for i in range(3), sep='')

### FIXED CODE ###

c = [input() for i in range(3)]
for i in range(3):
    print(c[i][i], end='', sep='')
n,k=map(int,input().split())
mon=list(map(int,input().split()))
mon.sort(reverse=True)
for i in range(k):
  mon.pop(0)
print(sum(mon))

### FIXED CODE ###

n,k=map(int,input().split())
mon=list(map(int,input().split()))
mon.sort(reverse=True)

print(sum(mon[k:]))
def cal_position(a, i):
    x = 1
    for j in range(1, i+1):
        x *= (a - (j-1)) / j
    return x


def cal_pattern(position_num, red_num):
    return (cal_position(position_num + red_num, position_num)) % 1000000007


N, K = map(int, input().split())
for i in range(K):
    red_num = N - K - i
    if red_num < 0:
        print(0)
    else:
        ans = cal_position(K-1, i)
        ans *= cal_pattern(i+1, red_num)
        print(int(ans))

### FIXED CODE ###

def cal(n, i):
    numerator = 1
    denominator = 1
    for j in range(1, i+1):
        numerator *= (n-j+1) 
        denominator *= j
    x = numerator // denominator
    return x

N, K = map(int, input().split())
for i in range(1, K+1):
    if i > N-K+1:
        print(0)
    else:
        ans = cal(N-K+1, i)
        ans *= cal(K-1, i-1)
        ans = ans % 1000000007
        print(int(ans))
import sys
sys.setrecursionlimit(500005)
readline = sys.stdin.buffer.readline

def main():
    H, W, M = map(int, readline().rstrip().split())
    HW = [[0] * W for _ in range(H)]
    HB = [0] * H
    WB = [0] * W
    for _ in range(M):
        h, w = map(int, readline().rstrip().split())
        h -= 1
        w -= 1
        HW[h][w] = 1
        HB[h] += 1
        WB[w] += 1
    hb = max(HB)
    max_h = [i for i, x in enumerate(HB) if x == hb]
    wb = max(WB)
    max_w = [i for i, x in enumerate(WB) if x == wb]
    
    ans = hb + wb
    for mh in max_h:
        for mw in max_w:
            if HW[mh][mw] == 0:
                print(ans)
                exit()
    print(ans - 1)

if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    import sys
    from collections import defaultdict
    readline = sys.stdin.readline

    H, W, M = map(int, readline().rstrip().split())
    HB = [0] * H
    WB = [0] * W
    HW = defaultdict(lambda : False)
    for _ in range(M):
        h, w = map(int, readline().rstrip().split())
        h -= 1
        w -= 1
        HW[(h,w)] = True
        HB[h] += 1
        WB[w] += 1
    hb = max(HB)
    max_h = [i for i, x in enumerate(HB) if x == hb]
    wb = max(WB)
    max_w = [i for i, x in enumerate(WB) if x == wb]
    
    ans = hb + wb
    for mh in max_h:
        for mw in max_w:
            if HW[(mh, mw)] == False:
                print(ans)
                sys.exit(0)
    print(ans - 1)

if __name__ == "__main__":
    main()
N = int(input())
A = [0]+[int(input()) for _ in range(N)]

v = {1}
x = 1
a = 0
while True:
  x = A[x]
  a += 1
  if x in v:
    print(-1)
    break
  if x == 2:
	print(a)
    break

### FIXED CODE ###

N = int(input())
A = [0]+[int(input()) for _ in range(N)]

v = set()
v.add(1)
x = 1
a = 0
while True:
  x = A[x]
  a += 1
  if x in v:
    print(-1)
    break
  if x == 2:
    print(a)
    break
  v.add(x)
import itertools

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

def fun(a):
    return max(a)-min(a)
def fun1(a):
    return sum(a) % (1000000007)
_1 = [fun(i) for i in itertools.combinations([int(i) for i in A], K)]    
print(fun1(_1))

mod = 10**9 + 7
 
def nCr(n,r):
  if n < r:
    return 0
  if n < 0 or r < 0:
    return 0
  return (fac[n] * facinv[r] * facinv[n - r]) % mod

### FIXED CODE ###

asc = 'abcdefghijklmnopqrstuvwxyz'
t=input()
for i in range(25):
    if t == asc[i]:
        print(asc[i+1])
n = int(input())
l = list(map(int, input().split()))
mod = 10**9+7
if n % 2 == 0 and len(set(l)) == n/2:
  print(int(2**(n/2)%mod))
elif not n % 2 == 0 and l.count(0) == 1:
  print(int(2**((n-1)/2)%mod))
else:
  print(0)


### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
mod = 10**9+7
if n % 2 == 0 and len(set(l)) == n//2:
  print(2**(n//2)%mod)
elif not n % 2 == 0 and l.count(0) == 1:
  print(2**((n-1)//2)%mod)
else:
  print(0)
#C - Day dream
S_input = input()
S = S_input
for i in range(len(S_input)):
    S = S[:i]+S_input[len(S_input)-1-i]+S[i+1:]
#print(S)
#S_input = input()
    
#S = S_input[::-1]
end_flg = 1
while end_flg:
    if S.startswith('maerd'):
        S = S.replace('maerd', '', 1)
    elif S.startswith('remaerd'):
        S = S.reaplace('remaerd','',1)
    elif S.startswith('esare'):
        S = S.replace('esare','',1)
    elif S.startswith('resare'):
        S = S.replace('resare', '', 1)
    else:
        end_flg = 0
if len(S_input) == 0:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

#C - Day dream
S_input = input()
S = S_input
for i in range(len(S_input)):
    S = S[:i]+S_input[len(S_input)-1-i]+S[i+1:]
#print(S)
#S_input = input()
    
#S = S_input[::-1]
end_flg = 1
while end_flg:
    if S.startswith('maerd'):
        S = S.replace('maerd', '', 1)
    elif S.startswith('remaerd'):
        S = S.replace('remaerd','',1)
    elif S.startswith('esare'):
        S = S.replace('esare','',1)
    elif S.startswith('resare'):
        S = S.replace('resare', '', 1)
    else:
        end_flg = 0
if len(S) == 0:
    print('YES')
else:
    print('NO')
N = int(input())
A = list(map(int, input().split()))

ans = 0
if A[0] >= 1:
    ans = -1
if N == 0:
    if A[0] == 0:
        ans = 1
    else:
        ans = -1
else:
    node_num = {N: A[N]}
    max_parent_num = {0: 1}
    for i in range(1, N+1):
        max_parent_num[i] = max_parent_num[i-1] * 2 - A[i]

    for i in range(N, 0, -1):
        if node_num[i] > min(2**i, A[i] + max_parent_num[i]):
            ans = -1
            break
        #i-1 no parent wo tukuru
        if node_num[i] <= max_parent_num[i-1]:
            i_1_parent_num = node_num[i]
        else:
            i_1_parent_num = max_parent_num[i-1]
        node_num[i-1] = i_1_parent_num + A[i-1]
    if node_num[0] > min(1, A[0] + max_parent_num[0]):
        ans = -1

if ans == -1 or ans == 1:
    print(ans)
else:
    ans = sum(node_num.values())
    print(ans)


### FIXED CODE ###

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

ans = 0
if N == 0:
    if A[0] >= 2:
        ans = -1
    else:
        ans = 1

if N >= 1 and A[0] >= 1:
    ans = -1

if N >= 1:
    node_num = {N: A[N]}
    max_parent_num = {0: 1}
    for i in range(1, N+1):
        max_parent_num[i] = max_parent_num[i-1] * 2 - A[i]

    for i in range(N, 0, -1):
        if node_num[i] > A[i] + max_parent_num[i]:
            ans = -1
            break
        #i-1 no parent wo tukuru
        if node_num[i] <= max_parent_num[i-1]:
            i_1_parent_num = node_num[i]
        else:
            i_1_parent_num = max_parent_num[i-1]
        node_num[i-1] = i_1_parent_num + A[i-1]
        if i == 1:
            if node_num[i-1] != 1:
                ans = -1
                break

if ans == -1 or ans == 1:
    print(ans)
else:
    ans = sum(node_num.values())
    print(ans)
a=input()
a=int(a)
b=list(map(int,input().split()))
b.sort()
print(b[a]-b[0])

### FIXED CODE ###

a=input()
a=int(a)
b=list(map(int,input().split()))
b.sort()
print(b[a-1]-b[0])
print(4<<int(input())-2)

### FIXED CODE ###

x = int(input())
now = 3
for _ in range(x):
  now = now*2+1
print(now-1)
n = int(input())
s = input()
k = int(input())
ss = ""
for i in range(n):
    if(s[k] != s[i]):
        ss[i] = "*"
    else:
        ss[i] = s[k]
print(ss)

### FIXED CODE ###

n = int(input())
s = input()
k = int(input())
w = s[k-1]
ss = ""
for i in range(n):
    if(s[i] == w):
        ss += w
    else:
        ss += "*"
print(ss)
s = input()
t = input()

flag = True
for i in range(s):
  if s[i] is not t[i]:
    flag = False
if flag is True:
  print("Yes")
else:
  print("No")
    

### FIXED CODE ###

s = input()
t = input()
 
flag = True
for i in range(len(s)):
  if s[i] is not t[i]:
    flag = False
if flag is True:
  print("Yes")
else:
  print("No")
n = int(input())
ans = 0
p = [0,0]
now = [0,0]
p[0] = n%10
p[1] = 10 - n%10
n = n//10
ans = min(p[0], p[1] + 1)
while n > 0:
  now[0] = min(p[0] + n%10, p[1] + n%10 + 1)
  now[1] = min(p[0] + 10 - n%10, p[1] + 9 - n%10)
  ans = min(now[0], now[1] + 1)
  n = n//10
  p = now.copy()
print(ans)


### FIXED CODE ###

import sys
n = [int(i) for i in sys.stdin.readline().rstrip()[::-1]]
ans = 0
i = 0
p = [n[i],10 - n[i]]
now = [0,0]
i += 1
ans = min(p[0], p[1] + 1)
for i in range(1,len(n)):
  now[0] = min(p[0] + n[i]%10, p[1] + n[i]%10 + 1)
  now[1] = min(p[0] + 10 - n[i]%10, p[1] + 9 - n[i]%10)
  ans = min(now[0], now[1] + 1)
  p[0],p[1] = now[0],now[1]
print(ans)
import sys

input = sys.stdin.buffer.readline

n, x, mod = map(int, input().split())
ans = 0
temp = x
num = 1
# while temp < mod:
#     temp *= x
#     num += 1


A = [0] * (mod + 1)

kouho = {}
if n < mod:
    A[1] = x % mod
    ans += A[1]
    for i in range(2, n + 1):
        A[i] = A[i - 1] * A[i - 1] % mod
        ans += A[i]
        # print(ans)
else:
    A[1] = x
    ans += A[1]
    kouho[A[1]] = 1
    temp = A[1]
    for i in range(2, mod + 1):
        A[i] = temp * temp % mod
        if A[i] in kouho:
            migi = i
            break
        kouho[A[i]] = i
        temp = A[i]
    saisho = 0
    hidari = kouho[A[i]]
    saisho = sum(A[1:hidari])
    # for i in range(1, hidari):
    #     saisho += A[i]
    cycle_val = sum(A[hidari:migi])
    # cycle_val = 0
    # for i in range(hidari, migi):
    #     cycle_val += A[i]
    cycle = migi - hidari
    if cycle >= 2:

        kaisu = n // cycle
        amari = n % cycle - (hidari - 1)
        amari %= cycle
        kaisu = (n - (amari + hidari - 1)) // cycle
        amari_val = sum(A[hidari : hidari + amari])
        # amari_val = 0
        # for i in range(hidari, hidari + amari):
        #     amari_val += A[i]
        ans = saisho + cycle_val * kaisu + amari_val
    else:
        ans = 0
        if cycle == 0:
            for j in range(1, i + 1):
                ans += A[j]
        else:
            for j in range(1, i + 1):
                ans += A[j]
            ans += (n - i) * A[j]
print(ans)



### FIXED CODE ###

import sys

input = sys.stdin.buffer.readline

n, x, mod = map(int, input().split())
ans = 0
temp = x
num = 1
# while temp < mod:
#     temp *= x
#     num += 1


A = [0] * (mod + 1)

kouho = {}
if n < mod:
    A[1] = x % mod
    ans += A[1]
    for i in range(2, n + 1):
        A[i] = A[i - 1] * A[i - 1] % mod
        ans += A[i]
        # print(ans)
else:
    A[1] = x
    ans += A[1]
    kouho[A[1]] = 1
    temp = A[1]
    i = 1
    migi = 1
    for i in range(2, mod + 1):
        A[i] = temp * temp % mod
        if A[i] in kouho:
            migi = i
            break
        kouho[A[i]] = i
        temp = A[i]
    saisho = 0
    hidari = kouho[A[i]]
    saisho = sum(A[1:hidari])
    # for i in range(1, hidari):
    #     saisho += A[i]
    cycle_val = sum(A[hidari:migi])
    # cycle_val = 0
    # for i in range(hidari, migi):
    #     cycle_val += A[i]
    cycle = migi - hidari
    if cycle >= 2:

        kaisu = n // cycle
        amari = n % cycle - (hidari - 1)
        amari %= cycle
        kaisu = (n - (amari + hidari - 1)) // cycle
        amari_val = sum(A[hidari : hidari + amari])
        # amari_val = 0
        # for i in range(hidari, hidari + amari):
        #     amari_val += A[i]
        ans = saisho + cycle_val * kaisu + amari_val
    else:
        ans = 0
        if cycle == 0:
            for j in range(1, i + 1):
                ans += A[j]
        else:
            for j in range(1, i + 1):
                ans += A[j]
            ans += (n - i) * A[j]
print(ans)
a, b, k = map(int, input().split())
l = []
for i in range(1, max(a, b)):
    if a%i == 0 and b%i == 0:
        l.append(i)
print(l[-k])

### FIXED CODE ###

a, b, k = map(int, input().split())
l = []
for i in range(1, min(a, b)+1):
    if a%i == 0 and b%i == 0:
        l.append(i)
print(l[-k])
def main():
    N, M = map(int, input().split())
    a = [0] * (1 + 10 ** 5)
    for _ in range(M):
        a[int(input())] = 1
    dp = [0] * (N + 1)
    dp[0] = 1
    if not a[1]:
        dp[1] = 1

    for i in range(2, N + 1):
        if not a[i]:
            dp[i] = 0
        else:
            dp[i] += dp[i-1] + d[i-2]
            dp[i] %= 1000000007

    print(dp[N])

main()


### FIXED CODE ###

N, M = map(int, input().split())
a = set(int(input()) for _ in range(M))
dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1

for i in range(2, N + 1):
    for k in [-2, -1]:
        if i + k not in a:
            dp[i] += dp[i+k]

print(dp[N] % 1000000007)
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

# 繰り返し二乗法
def pow_r_mod(x:int, n:int, mod=10**9+7)->int:
    # 計算量 : log N
    if n == 0:
        return 1
    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
        x *= x
        x %= mod
        n //= 2
    return (K * x) % mod

m, a, b = mi()

P = 10**9+7
N = 2*(10**5)+1
inv_t = [0]+[1]
# 逆元
for i in range(2, N):
  inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

mca = mcb = 1

for i in range(1, a+1):
    mca *= (m-i+1) * inv_t[i]
    mca %= P

mcb = mca

for i in range(a+1, b+1):
    mcb *= (m-i+1) * inv_t[i]
    mcb %= P

print((pow_r_mod(2, m)-1-mca-mcb) % P)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

m, a, b = mi()

P = 10**9+7
N = 2*(10**5)+1
inv_t = [0]+[1]
for i in range(2,N):
  inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

mca = mcb = 1

for i in range(1, a+1):
    mca *= (m-i+1) * inv_t[i]
    mca %= P

for i in range(1, b+1):
    mcb *= (m-i+1) * inv_t[i]
    mcb %= P

print(((2**m)-mca-mcb-1)%P)