Harryxun/stf_run huggingface dataset:
from scipy.sparse.csgraph import dijkstra
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]

graph = [[0]*(n+1) for _ in range(n+1)]
for a, b in ab:
    graph[a-1][b-1] = 1

ans = 0
inf = 10**9

for a, b in ab:
    graph[a][b] = inf
    dist = dijkstra(graph, indices = a, directed = False)
    if dist[b] >= inf:
        ans += 1
    graph[a][b] = 1

print(ans)


### FIXED CODE ###

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

from collections import deque

def bfs(u):
    queue = deque([u])
    d = [None] * n # uからの距離の初期化
    d[u] = 0 # 自分との距離は0
    while queue:
        v = queue.popleft()
        for i in graph[v]:
            if d[i] is None:
                d[i] = d[v] + 1
                queue.append(i)
    flag=True
    for _i in range(n):
        if d[_i]==None:
            flag=False
    return flag

cnt=0
for i in range(m):
    graph = [[] for _ in range(n)]
    for j in range(m):
        if i!=j:
            graph[ab[j][0]-1].append(ab[j][1]-1)
            graph[ab[j][1]-1].append(ab[j][0]-1)
    if not bfs(0):
        cnt+=1
print(cnt)
S = list(input())

out = Good

for i in range(0,4):
  if S[i] == S[i+1]:
    out = "Bad"
    
print(out)


  

### FIXED CODE ###

S = list(input())

out = "Good"

for i in range(0,3):
  if S[i] == S[i+1]:
    out = "Bad"
    
print(out)
i = list(map(int, input().split()))
if 1 <= i[0] <= 9 and 1 <= i[1] <= 9:
  return i[0] * i[1]
else:
  return -1


### FIXED CODE ###

i = list(map(int, input().split()))
if 1 <= i[0] <= 9 and 1 <= i[1] <= 9:
  print(i[0] * i[1])
else:
  print(-1)
n,m = map(int, input().split())
a = [input() for _ in range(m)]
b = set(a)
c = [list(map(int, ai.split())) for ai in a]
d = dict(c)

if len(d) != len(b):
    print(-1)
else:
    if n == 1:
        print(d[1])
    else:
        if d[1] == 0:
            print(-1)
        else:
            ans = ["0"] * n
            for k in d:
                ans[k-1] = str(d[k])
            print(int("".join(ans)))


### FIXED CODE ###

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

x = 10 ** (n - 1)
if n == 1: x = 0
ans = [-1]

while x < 10 ** n:
    s = str(x)
    if all(s[int(ai[0]) - 1] == ai[2] for ai in a):
        ans.append(x)
        break
    x += 1

print(ans[-1])
import sys
import math

x, n = map(int, input().split())
if n == 0:
    print(x)
    sys.exit()

p_list = list(map(int, input().split()))

p_list.sort()

for i in range(n):
    if p_list[i] == x:
        j = i
        k = 1
        while j <= n-1:
            if p_list[i-k] != x-k and i != 0:
                print(x-k)
                sys.exit()
            elif p_list[i+k] != x+k and i != n-1:
                print(x+k)
                sys.exit()
            j += 1
            k += 1
    if p_list[i] > x:
        print(x)
        break


#sub = min(abs(p_list[j] - x), abs(p_list[j-1] -x))

### FIXED CODE ###

x, n = map(int, input().split())
if n == 0:
    print(x)
    exit()

p = list(map(int, input().split()))

#p.sort()

for i in range(101):
    if x -i not in p:
        print(x-i)
        exit()
    elif x +i not in p:
        print(x+i)
        exit()
def find(x):
    if x == par[x]:
        return x
    par[x] = find(par[x])
    return par[x]

def union(x,y):
    x,y = find(x),find(y)
    if x == y:
        return
    par[y] = x

n,m = map(int,input().split())
par = {i:i for i in range(1,n+1)}
for _ in range(m):
    a,b,c = map(int,input().split())
    union(a,b)
print(len(set(par.values()))

### FIXED CODE ###

def find(x):
    if x == par[x]:
        return x
    par[x] = find(par[x])
    return par[x]
 
def union(x,y):
    x,y = find(x),find(y)
    if x == y:
        return
    par[y] = x
 
n,m = map(int,input().split())
par = {i:i for i in range(1,n+1)}
for _ in range(m):
    a,b,c = map(int,input().split())
    union(a,b)
print(sum([1 for i in range(1,n+1) if par[i] == i]))
S = input()
n = [1]*len(S)


for j in range(count):
    for i in range(len(S)):
        if S[i] == "R":
            if n[i] >0:
                
                n[i+1] += 1
                n[i] -=1
        if S[i] == "L":
            if n[i] >0:
                n[i-1] += 1
                n[i] -=1
print(n)

### FIXED CODE ###

s=input()
s="L"+s+"R"
N=len(s)
a=[1]*N
for i in range(1,N-1):
    if s[i]=="R" and s[i+1]=="R":
        a[i+2]+=a[i]
        a[i]=0
for i in range(N-1,1,-1):
    if s[i]=="L" and s[i-1]=="L":
        a[i-2]+=a[i]
        a[i]=0
print(*a[1:-1])
N,K = map(int,input().split())

D = set(map(int,input().split()))
A = {1,2,3,4,5,6,7,8,9,0}
N_list = [int(c) for c in str(N)]

use = sorted(list(A - D))

ans = [max(use) for i in range(len(N_list))]
mapans = map(str,ans)
x = int(''.join(mapans))
if N == x:
    print(x)
elif N > x:
    if use[0]!= 0:
        ans = [use[0] for i in range(len(N_list)+1)]
    else:
        ans = [use[0] for i in range(len(N_list))+1]
        ans[0] = use[1]

    mapans = map(str,ans)
    x = int(''.join(mapans))
else:
    if use[0]!= 0:
        ans = [use[0] for i in range(len(N_list))]
    else:
        ans = [use[0] for i in range(len(N_list))]
        ans[0] = use[1]

    mapans = map(str,ans)
    x = int(''.join(mapans))
    j = 0
    i = 0
    while x < N:
        if ans[j] > N_list[j]:
            for k in range(len(ans)-j-1):
                ans[k] = min(use)
        elif ans[j] == N_list[j]:
            i = 0
            j+=1
        else:
            ans[j] = use[i]
            i += 1
    mapans = map(str,ans)
    x = int(''.join(mapans))

    print(x)


### FIXED CODE ###

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

D = set(map(int,input().split()))
A = {1,2,3,4,5,6,7,8,9,0}
N_list = [int(c) for c in str(N)]

use = sorted(list(A - D))

ans = [max(use) for i in range(len(N_list))]
mapans = map(str,ans)
x = int(''.join(mapans))
if N == x:
    print(x)
elif N > x:
    if use[0]!= 0:
        ans = [use[0] for i in range(len(N_list)+1)]
    else:
        ans = [use[0] for i in range(len(N_list)+1)]
        ans[0] = use[1]

    mapans = map(str,ans)
    x = int(''.join(mapans))
    print(x)
else:
    if use[0]!= 0:
        ans = [use[0] for i in range(len(N_list))]
    else:
        ans = [use[0] for i in range(len(N_list))]
        ans[0] = use[1]

    mapans = map(str,ans)
    x = int(''.join(mapans))
    j = 0
    i = 0
    while x < N:
        if ans[j] > N_list[j]:
            for k in range(len(ans)-j-1):
                ans[k] = min(use)
        elif ans[j] == N_list[j]:
            i = 0
            j+=1
        else:
            i += 1
            ans[j] = use[i]
        mapans = map(str,ans)
        x = int(''.join(mapans))

    print(x)
n, k = map(int,input().split())
a = list(map(int,input().split()))

route = []
i = 0

# 方針は合っていたが，
while True:
    ne = a[i]

    if i not in route:
        route.append(i)
    else:
        temp = len(route) - len(route[i:])
        if k < temp:
            print(a[k])
        else:
            print(a[(k-temp)%len(route[i:])])
        break

    i = ne - 1

### FIXED CODE ###

from collections import defaultdict

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

route = defaultdict(int)
i = 0
loop = []
tail = []

while route[i] < 2:

    if route[i] == 0:
        tail.append(i)
    else:
        loop.append(i)
    
    route[i] += 1
    i = a[i] - 1

if len(tail) > k:
    print(tail[k] + 1)
else:
    temp = len(tail) - len(loop)
    print(loop[(k-temp) % len(loop)] + 1)
import sys
input = sys.stdin.readline


def log(*args):
    print(*args, file=sys.stderr)


def main():
    _n, _m, k = map(int, input().split())
    ns = list(map(int, input().rstrip().split()))
    ms = list(map(int, input().rstrip().split()))
    sum = 0
    count = 0
    for v in ns:
        if sum + v > k:
            break
        else:
            sum += v
            count += 1

    ans_now = count
    ans = ans_now
    i = count - 1
    for v in ms:
        if sum + v > k:
            while sum + v > k:
                sum -= ns[i]
                i -= 1
                ans_now -= 1
                if i < 0:
                    break
            if sum + v > k:
                break
            sum += v
            ans_now += 1
        else:
            sum += v
            ans_now += 1
        ans = max(ans, ans_now)
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline


def log(*args):
    print(*args, file=sys.stderr)


def main():
    _n, _m, k = map(int, input().split())
    ns = list(map(int, input().rstrip().split()))
    ms = list(map(int, input().rstrip().split()))
    sum = 0
    count = 0
    for v in ns:
        if sum + v > k:
            break
        else:
            sum += v
            count += 1

    ans_now = count
    ans = ans_now
    i = count - 1
    for v in ms:
        if sum + v > k:
            while sum + v > k:
                if i < 0:
                    break
                sum -= ns[i]
                i -= 1
                ans_now -= 1
            if sum + v > k:
                break
            sum += v
            ans_now += 1
        else:
            sum += v
            ans_now += 1
        ans = max(ans, ans_now)
    print(ans)


if __name__ == '__main__':
    main()
from itertools import accumulate

def main():
    int: n, k, i, j, ans, num, cnt, b
    list: a, btfl
    
    n, k = map(int, input().split())
    a = [0] + list(accumulate(map(int, input().split())))

    btfl = []
    for i in range(0, n):
        for j in range(i + 1, n + 1):
            btfl.append(a[j] - a[i])

    # 解説AC
    ans = 0
    for i in range(50)[::-1]:
        num, cnt = ans + pow(2, i), 0
        for b in btfl:
            if num == num & b:
                cnt += 1
        if cnt >= k:
            ans = num
    print(ans)

if __name__ == '__main__':
    main()


### FIXED CODE ###

from itertools import accumulate
n, k = map(int, input().split())
a = [0] + list(accumulate(map(int, input().split())))

btfl = []
for i in range(0, n):
    for j in range(i + 1, n + 1):
        btfl.append(a[j] - a[i])

# 解説AC
ans = 0
for i in range(50)[::-1]:
    num, cnt = ans + pow(2, i), 0
    for b in btfl:
        if num == num & b:
            cnt += 1
    if cnt >= k:
        ans = num
print(ans)
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

DIV_NUM = 1000000000 + 7

INPUT_NUMS = list(map(int, input().split()))
N=int(INPUT_NUMS[0])
K=int(INPUT_NUMS[1])

A = [int(x) for x in input().split()]
AA = np.array(A)
if N==1:
    print(0)
    exit()

tree = np.array([0] * (N+1) )

# https://atcoder.jp/contests/chokudai_S001/submissions/6789704
def BIT_update(tree,x):
    while x <= N:
        tree[x] += 1
        x += x&(-x)
def BIT_sum(tree,x):
    s = 0
    while x:
        s += tree[x]
        x -= x&(-x)
    return s

answer = N*(N-1)//2
for x in AA:
    answer -= BIT_sum(tree,x)
    BIT_update(tree,x)

B = sorted(A)

q=0
p=B[0]
r=0
for i in range(1,N):
    if B[i]>p:
        p=B[i]
        r=i
    q += r

# print(answer,K)
answer = answer % DIV_NUM
answer = (answer * K) % DIV_NUM
q = q % DIV_NUM
answer = answer + q * K * (K-1) // 2
answer = answer % DIV_NUM
print(answer)



### FIXED CODE ###

# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

DIV_NUM = 1000000000 + 7

INPUT_NUMS = list(map(int, input().split()))
N=int(INPUT_NUMS[0])
K=int(INPUT_NUMS[1])

A = [int(x) for x in input().split()]
AA = np.array(A)
if N==1:
    print(0)
    exit()

# https://kira000.hatenadiary.jp/entry/2019/02/23/053917
def bubble_sort(A):
    cnt = 0
    for i in range(len(A)):
        for j in range(len(A)-1, i, -1):
            if A[j] < A[j-1]:
                A[j], A[j-1] = A[j-1], A[j]
                cnt += 1
    return cnt

answer = bubble_sort(AA)

B = sorted(A)
q=0
p=B[0]
r=0
for i in range(1,N):
    if B[i]>p:
        p=B[i]
        r=i
    q += r

# print(answer,K)
answer = answer % DIV_NUM
answer = int(answer)
answer = (answer * K) % DIV_NUM
q = q % DIV_NUM
answer = answer + q * K * (K-1) // 2
answer = answer % DIV_NUM
print(answer)
def flog1(n):
    if A[n] != 0:
        return A[n]
    if n == 0:
        a = 0
    elif n == 1:
        a = abs(h[0] - h[1])
    else:
        a = min(flog1(n - 1) + abs(h[n - 1] - h[n]),flog1(n -2) + abs(h[n - 2] - h[n]))
    A[n] = a
    return a

N = int(input())
h = list(map(int,input().split()))
A = [0] * N
print(flog1(N - 1))

### FIXED CODE ###

N = int(input())
h = list(map(int,input().split()))
dp = [0] * N
dp[1] = abs(h[1] - h[0])
for i in range(N - 2):
    dp[i + 2] = min(dp[i] + abs(h[i] - h[i + 2]),dp[i + 1] + abs(h[i + 1] - h[i + 2]))
print(dp[N - 1])
n, T = map(int, input().split())
ans = 'TLE'
for i in range(n):
  c, t = map(int, input().split())
  if t <= T:
    ans = min(ans, c)
print(ans)

### FIXED CODE ###

n, t = map(int, input().split())
m = float('inf')
for i in range(n):
  cost, time = map(int, input().split())
  if time <= t:
    m = min(m, cost)
if m == float('inf'):
  print('TLE')
else:
  print(m)
from math import gcd
def main():
    a,b=map(int,input().split())
    print(a*b//gcd(a,b))

main()

### FIXED CODE ###

from fractions import gcd
def main():
    a,b=map(int,input().split())
    print(a*b//gcd(a,b))
 
main()
s = int(input())
m = s/60
h = m/60

print(h":"m":"s)

### FIXED CODE ###

a = int(input())
h = int(a/3600)
m=int((a%3600)/60)
s=int((a%3600)%60)

print(h,m,s,sep=":")
"""
ある街にN人のすぬけ君(すぬけ君1、すぬけ君2、 ...、 すぬけ君N)が住んでいます。

"""
n, k = map(int, input().split())
input_map = {}
for i in range(k):
    d = int(input())
    list = list(input().split())
    input_map.setdefault(i, list)

cnt = 0
having_list = input_map(k)
for j in having_list:
    cnt += 1

print(cnt)


### FIXED CODE ###

"""
ある街にN人のすぬけ君(すぬけ君1、すぬけ君2、 ...、 すぬけ君N)が住んでいます。

"""
n, k = map(int, input().split())
n_list = list(range(1, n+1))
input_map = {}
for i in range(k):
    d = int(input())
    d_list = [ int(ai) for ai in input().split()]
    for h in d_list:
        if n_list.count(h) == 1:
            n_list.remove(h)

print(len(n_list))
import numpy

N, M = map(int, input().split())
R = numpy.array([[int(r) for r in input().split()] for _ in range(M)]) - 1

size = [1] * N

groups = numpy.array([-1] * N)
gnum = 1
sameinfo = []

for p1, p2 in R:

    g1 = groups[p1]
    g2 = groups[p2]

    if g1 == -1 and g2 == -1:
        groups[p1] = gnum
        groups[p2] = gnum
        gnum += 1

    elif g1 != -1 and g2 == -1:
        groups[p2] = g1

    elif g1 == -1 and g2 != -1:
        groups[p1] = g2

    elif g1 != -1 and g2 != -1:
        sameinfo.append([min(g1, g2), max(g1, g2)])
    
    elif g1 == g2:
        continue

for s1, s2 in sameinfo:
    groups[groups == s2] = s1


groups = groups[groups != -1]
maxgroup = numpy.argmax(numpy.bincount(groups))
print(numpy.count_nonzero(groups == maxgroup))

### FIXED CODE ###

import numpy

class UnionFind:
    def __init__(self, N):
        self.N = N

        # the parent of all node is itself
        # self.parent = list(range(N))
        self.parent = [-1] * N

    def root(self, i):
        if self.parent[i] < 0:
            return i

        r = self.root(self.parent[i])
        self.parent[i] = r
        return r

    def unite(self, i, j):
        # print('root {}, {} = '.format(i, j), end='')
        i = self.root(i)
        j = self.root(j)
        # print(i, j)

        if i == j:
            return

        if i > j:
            i, j = j, i

        self.parent[i] += self.parent[j]
        self.parent[j] = i
        # print(self.parent)

    def same(self, i, j):
        return self.root(i) == self.root(j)

    def size(self, i):
        return -self.parent[self.root(i)]

N, M = map(int, input().split())
R = numpy.array([[int(r) for r in input().split()] for _ in range(M)]) - 1

forest = UnionFind(N)
for p1, p2 in R:
    forest.unite(p1, p2)

s = [forest.size(i) for i in range(N)]
print(max(s))
def lcs_size():
  X = raw_input()
  Y = raw_input()
  
  a = len(X)
  b = len(Y)
  
  z2 = [0 for in range(b+1)]
  for i in range(a):
    z1 = z2 + []
    for j in range(b):
      if X[i] == Y[j]:
        z2[j+1] = z1[j] + 1
      elif z2[j+1] < z2[j]: 
        z2[j+1] = z2[j]
  
  return z2[-1]

q = input()

for i in range(q):
  print lcs_siz()

### FIXED CODE ###

def lcs_size():
  X = raw_input()
  Y = raw_input()
  a = len(X)
  b = len(Y)
  z2 = [0 for i in range(b+1)]

  for i in range(a):
    ch = X[i]
    z1 = z2 + []
    for j in range(b):
      if ch == Y[j]:
        z2[j+1] = z1[j] + 1
      elif z2[j+1] < z2[j]:
        z2[j+1] = z2[j]

  return z2[-1]

q = input()
for k in range(q):
  print lcs_size()
n,m = map(int,input().split())

if n == 1:
    print(m)
    exit()
    
if n >= len(L):
    print(1)
    exit()
    
div = 2
L = []
i = 1
while div <= int(m**0.5)+1:
    while m%div == 0:
        m //=div
        L.append(div)
    div +=1
L.append(m)
#print(L)

from collections import Counter
L = Counter(L)

cnt = 1
for k,v in L.items():
    if v >= n:
        cnt *=k
print(cnt)

### FIXED CODE ###

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

div = 2
L = []
i = 1
while div <= int(m**0.5)+1:
    while m%div == 0:
        m //=div
        L.append(div)
    div +=1
if m!= 1:
    L.append(m)
#L.append(1)

from collections import Counter
L = Counter(L)

cnt = 1
for k,v in L.items():
    cnt *=k**(v//n)
print(cnt)
n=int(input())
if n%2==0:
  ans=n//2-1
else:
  ans==n//2

print(ans)

### FIXED CODE ###

n=int(input())
if n%2==0:
  ans=n//2-1
else:
  ans=n//2

print(ans)
n,k,q = map(int, input().split())
b = []
for i in range(n):
    b.append(0)
for i in range(q):
    a = int(input())
    b[a] += 1
for i in range(n):
    if b[i] > q - k:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

n,k,q = map(int, input().split())
b = []
for i in range(n):
    b.append(0)
for i in range(q):
    a = int(input())
    b[a-1] += 1
for i in range(n):
    if b[i] > q - k:
        print('Yes')
    else:
        print('No')
# coding: utf-8
# Your code here!
# from collections import Counter
# from functools import *

def LI():
    return list(map(int,input().split()))

n,k=LI()
a=LI()
b=[]
visited=[-1]*n


now=1
for i in range(k):
    nxt=a[now-1]
    b.append(nxt)
    if visited[nxt-1]==-1:
        visited[nxt-1]=i
    else:
        mod=(visited[nxt-1],i)
        break
    now=nxt
    # visited[now]
    # print(i,now)
# print(now,mod)

ml,mr=mod
k=(k-ml)%(mr-ml)+ml
# print(k)

# now=1
# for i in range(k):
#     now=a[now-1]
# print(now)
print(b[k-1])

### FIXED CODE ###

n,k=map(int,input().split())
a=[0]+list(map(int,input().split()))

MAX_N=2*10**5
b=[1]
visited=[-1]*(n+10)
for i in range(1,2*MAX_N+1):
    nxt=a[b[-1]]
    b.append(nxt)
        
if k<=n:
    print(b[k])
    exit()
# print(b)  
for i,bi in enumerate(b):
    if visited[bi]==-1:
        visited[bi]=i
    else:
        m=i-visited[bi]
        l=visited[bi]
        break
k=k%m

while k<n:
    k+=m
print(b[k])
N, K = map(int, input().split())
A = list(map(int, input().split()))
m = 10**9+7
if K == 1:
    print(max(A)%m)
    exit()
p = []
q = []
r = []
for i in range(N):
    if A[i] > 0:
        p.append(A[i])
    elif A[i] < 0:
        q.append(A[i])
    else:
        r.append(A[i])
p.sort()
q.sort()
P = len(p)
Q = len(q)
if P+Q < K:
    print(0)
    exit()
else:
    if P == Q == 1:
        print(p[0]*q[0]%m)
        exit()
    if P == 0:
        if K%2 == 0:
            ans = 1
            for i in range(K):
                ans = ans * q[Q-1-i] % m
            print(ans)
        else:
            if len(r) > 0:
                print(0)
            else:
                ans = 1
                for i in range(K):
                    ans = ans * q[Q-1-i] % m
            print(ans)
    else:
        i = K# pから使う個数
        j = 0# qから使う個数
        while i > P:
            i -= 2
            j += 2
        
        while j < Q-1:
            if p[P-i]*p[P-i+1] < q[Q-j-1]*q[Q-j-2]:
                if i>1:
                    i -= 2
                j += 2
            else:
                break
        ans = 1
        for k in range(i):
            ans = ans * p[P-k-1] % m
        for l in range(j):
            ans = ans * q[Q-l-1] % m
        print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
m = 10**9+7
pos = [*filter(lambda x: x>=0, A)]
neg = [*filter(lambda x: x<0, A)]
pos.sort(reverse=True)
neg.sort()

ans = 1
i,j = 0,0# 使った数
while i+j < K:
    flag = True
    if i == len(pos):
        flag = False
    elif j == len(neg):
        flag = True
    elif pos[i] >= -neg[j]:
        flag = True
    else:
        flag = False

    if flag:
        ans = ans * pos[i] % m
        i += 1
    else:
        ans = ans * neg[j] % m
        j += 1

if j % 2 == 0 or N==K:
    print(ans)
elif len(pos) == 0:
    ans = 1
    for i in range(K):
        ans = ans * neg[len(neg)-1-i] % m
    print(ans)
else:
    flag2 = True
    if i == 0:
        flag2 = True
    elif j == 0:
        flag2 = False
    elif i == len(pos):
        flag2 = False
    elif j == len(neg):
        flag2 = True
    elif pos[i-1]*pos[i] > neg[j-1]*neg[j]:# = を抜いた
        flag2 = True
    else:
        flag2 = False

    if flag2:
        ans = ans * pow(neg[j-1],m-2,m) % m
        ans = ans * pos[i] % m
    else:
        ans = ans * pow(pos[i-1],m-2,m) % m
        ans = ans * neg[j] % m
    print(ans)
from operator import mul
from functools import reduce

import sys

sys.setrecursionlimit(20000000)

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


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

for i in range(1,k+1):
    print(( cmb(n-k+1,i) * cmb(k-1,i-1) ) % (10**9+7))


### FIXED CODE ###


from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

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

for i in range(1,k+1):
    if n - k + 1 >= i:
        print(( cmb(n-k+1,i) * cmb(k-1,i-1) ) % (10**9+7))
    #青を分けようとするけど赤玉の隙間がたらないとき
    else:
        print(0)
import collections
n = int(input())
v = list(map(int,input().split()))
odd = collections.Counter(v[0::2]).most_common()
even= collections.Counter(v[1::2]).most_common()
if odd[0][0] != even[0][0]:
    print(n - odd[0][1] - even[0][1])
else:
    print(n - max(odd[0][0] + even[1][0], odd[1][0] + even[0][0]))

### FIXED CODE ###

import collections
n = int(input())
v = list(map(int,input().split()))
odd = collections.Counter(v[0::2]).most_common()
even = collections.Counter(v[1::2]).most_common()
odd.append((0, 0))
even.append((0, 0))
if odd[0][0] != even[0][0]:
    print(n - odd[0][1] - even[0][1])
else:
    print(n - max(odd[0][1] + even[1][1], odd[1][1] + even[0][1]))
case = int(input())

A, B, C =[int(x) for x in case.split(' ')]
if (A == B and A != C) or(B == C and A != C) or (A == C and A != C):
    print('Yes')
else:
    print('No')

### FIXED CODE ###


case = input()

A, B, C =[int(x) for x in case.split(' ')]
if (A == B and A != C) or(B == C and A != C) or (A == C and A != B):
    print('Yes')
else:
    print('No')
H, W = map(int, input().split())
S = [list(input()) for _ in range(H)]

def aaa(i, j):
    cnt = 0
    for x in [-1, 0, 1]:
        for y in [-1, 0, 1]:
            if (not 0 <= i + y < H) or (not 0 <= j + x < W):
                continue
            if S[i + y][j + x] == '#':
                cnt += 1    
    return str(cnt)

for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            continue
        S[i][j] = aaa(i, j)
for s in S:
    print("".join(s))

### FIXED CODE ###

A, B, C = input().split()
if A == B:
    print(C)
elif B == C:
    print(A)
else:
    print(B)