Harryxun/stf_run huggingface dataset:
n, m = map(int, input().split(' '))
s = [list(map(int, input().split(' '))) for _ in range(m)]

dic = [x for x in range(n)]
result = [int(n*(n-1)/2)]
for i in range(1,m):
    if dic[s[-1*i][0]-1] == dic[s[-1*i][1]-1]:
        result.append(result[-1])
    else:
#        p = [x for x in dic if x == dic[s[-1*i][0]-1]]
#        q = [x for x in dic if x == dic[s[-1*i][1]-1]]
        p = x.count(dic[s[-1*i][0]-1])
        p = x.count(dic[s[-1*i][1]-1])
        result.append(result[-1]-len(p)*len(q))
        if len(p) < len(q):
            dic = [dic[s[-1*i][1]-1] if x == dic[s[-1*i][0]-1] else x for x in dic]
        else:
            dic = [dic[s[-1*i][0]-1] if x == dic[s[-1*i][1]-1] else x for x in dic]
for i in range(1,m+1):
    print(result[-1*i])

### FIXED CODE ###

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

c = [-1]*(m+2)

def find(num):
    if c[num] < 0:
        return num
    else:
        k = find(c[num])
        c[num] = k
        return k

result = [int(n*(n-1)/2)]
for i in range(m-1, 0,-1):
    x = find(a[i])
    y = find(b[i])

    if x != y:
        result.append(result[-1]-c[x]*c[y])
        x, y = sorted([x,y])
        c[x] += c[y]
        c[y] = x
    else:
        result.append(result[-1])

for i in result[::-1]:
    print(int(i))
p = list(map(int,input()split()))
if p[0] != p[1] and p[1] != p[2] and p[2] != p[0]:
  print(3)
elif p[0] = p[1] and p[1] = p[2]:
  print(1)
else:
  print(2)

### FIXED CODE ###

p = list(map(int,input().split()))
if p[0] != p[1] and p[1] != p[2] and p[2] != p[0]:
  print(3)
elif p[0] == p[1] == p[2]:
  print(1)
else:
  print(2)
# coding: utf-8
import math
x1,y1,x2,y2 = input().split()

X = int(x2) - int(x1)
Y = int(y2) - int(y1)

length = math.sqrt( X**2 + Y**2 )
print(length)

### FIXED CODE ###

# coding: utf-8
import math
x1,y1,x2,y2 = input().split()

X = float(x2) - float(x1)
Y = float(y2) - float(y1)

length = math.sqrt( X**2 + Y**2 )
print(length)
# ABC 057: B – Checkpoints
studentPoints = []
checkPoints = []
n, m = map(int, input().split())
for _ in range(n):
    studentPoints.append([int(s) for s in input().split()])
for _ in range(m):
    checkPoints.append([int(s) for s in input().split()])

for i in range(n):
    distances = [abs(studentPoints[i][0] - checkPoints[k][0]) + abs(studentPoints[i][1] - checkPoints[k][1]) for k in range(m)]
    target = distances.index(min(distances))
    print(target + 1)
    m -= 1

### FIXED CODE ###

# ABC 057: B – Checkpoints
n, m = [int(s) for s in input().split()]

a = []
b = []

for i in range(n):
    tmp = [int(s) for s in input().split()]
    a.append(tmp[0])
    b.append(tmp[1])

c = []
d = []

for j in range(m):
    tmp = [int(s) for s in input().split()]
    c.append(tmp[0])
    d.append(tmp[1])

for i in range(n):
    checkpoint = 0
    distance = abs(c[0] - a[i]) + abs(d[0] - b[i])
    
    for j in range(m):
        if distance > abs(c[j] - a[i]) + abs(d[j] - b[i]):
            distance = abs(c[j] - a[i]) + abs(d[j] - b[i])
            checkpoint = j
    
    print(checkpoint + 1)
s=list(map(int,input().split())
s.sort()
print(s[2]-s[0])


### FIXED CODE ###

s=list(map(int,input().split()))
s.sort()
print(s[2]-s[0])
N, K = map(int, input().split())
print(f"{N % K != 0:d}")

### FIXED CODE ###

N, K = map(int, input().split())
print(0 if N % K == 0 else 1)
import numpy as np

N, M, C = map(int, input().split())
B = list(map(int, input().split())) 
A = np.zeros((N,M))

A[0:] = list(map(int, input().split())) 
A[1:] = list(map(int, input().split())) 

cnt = 0
z = 0
for A_line in A:
    for i,a in enumerate(A_line):
        z = z + a*B[i]
    if z+C >0:
        cnt += 1
    z = 0

print(cnt)

### FIXED CODE ###

import numpy as np

N, M, C = map(int, input().split())
B = list(map(int, input().split())) 
A = np.zeros((N,M))



for i,_ in enumerate(A):
    A[i:] = list(map(int, input().split())) 

cnt = 0
z = 0
for A_line in A:
    for i,a in enumerate(A_line):
        z = z + a*B[i]
    if z+C >0:
        cnt += 1
    z = 0

print(cnt)
s = input()
t = input()
count = 0

for i in len(s):
	if s[i] == t[i]:
		count += 1

print(count)

### FIXED CODE ###

s = input()
t = input()
count = 0

for i in range(len(s)):
	if s[i] == t[i]:
		count += 1

print(count)
n,m = map(int,input().split())
branch = set(tuple(map(int,input().split())) for i in range(m))
que = range(n)
flag = -1
friend = [{1}]

for a,b in branch:
    for i in range(len(friend)):
        if (a in friend[i]) or (b in friend[i]):
            friend[i].add(a)
            friend[i].add(b)
            if flag >= 0:
                friend[flag] = friend[flag]|friend[i]
                friend.pop(i)
            flag = i
    if flag == -1:
        friend.append({a,b})
    else: flag = -1

len_friend = list(len(i) for i in friend)
print(max(len_friend))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)

class Graph:
    def __init__(self,n,side):
        self.side = side
        self.neighbor = [set() for i in range(n+1)]
        self.visited = [False]*(n+1)
        self.group =[0]*n
        self.product()
    def product(self):
        for a,b in self.side:
            self.neighbor[a].add(b)
            self.neighbor[b].add(a)
    def dfs(self,x,a):
        self.group[a] += 1
        self.visited[x] = True
        for i in self.neighbor[x]:
            if self.visited[i]:continue
            self.dfs(i,a)
    def all_dfs(self):
        a = 0
        for i in range(1,n+1):
            if not self.visited[i]:
                self.dfs(i,a)
                a += 1

n,m = map(int,input().split())
side = list(tuple(map(int,input().split()))for i in range(m))
graph1 = Graph(n,side)
graph1.all_dfs()
print(max(graph1.group))
def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]

N,M=map(int,input().split())
a=[]
b=[]
A=0
for i in range(M):
    a.append(list(map(int,input().split())))
    b.append(a[i][0])

aa=get_unique_list(a)
if len(set(b))!=len(aa):
    ans=-1

else:
    for j in range(len(aa)):
      A+=aa[j][1]*(10**(N-aa[j][0]))
      ans=A
if N!=len(str(ans)):
    ans=-1
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(M)]
dic = {}

# 一桁で0のときの対応
if sc == [] and N == 1:
    print(0)
    exit()
if sc == [[1, 0]] and N == 1:
    print(0)
    exit()

# 文字を組み立てます。
for k in sc:
    if k[0] in dic:
        if dic[k[0]] != k[1]:  # 重なったら即アウト
            print(-1)
            exit()
    else:
        dic[k[0]] = k[1]
ans = 0

if 1 in dic and dic[1] == 0:  # 一桁めが存在するかどうか判定している。
    print(-1)
    exit()
for k in dic:
    ans += 10**(N - k) * dic[k]
if ans < 10**(N - 1):
    ans += 10**(N - 1)
print(ans)
S = input()
min_ = 0
max_ = 0
flag_min = False
for i in len(S):
  if flag_min:
    if S[i] == "A":
      min_ = i
      flag_min = True
  else:
    if S[i] == "Z":
      max_ = i
      
print(max_ - min_ + 1)

### FIXED CODE ###

S = input()
min_ = 0
max_ = 0
flag_min = True
for i in range(len(S)):
  if flag_min:
    if S[i] == "A":
      min_ = i
      flag_min = False
  else:
    if S[i] == "Z":
      max_ = i
      
print(max_ - min_ + 1)
score = [0, 0]

n = int(raw_input())
for i in range(n):
    t, h = raw_input().split()
    if t < h:
        score[1] += 3
    elif t > h:
        score[0] += 3
    else:
        score[] += 1
print score[0], score[1]

### FIXED CODE ###

score = [0, 0]

n = int(raw_input())
for i in range(n):
    t, h = raw_input().split()
    if t < h:
        score[1] += 3
    elif t > h:
        score[0] += 3
    else:
        score[0] += 1
        score[1] += 1
print score[0], score[1]
from collections import deque
import sys

N = int(input())

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

mustuse = deque([])
ableuse = deque([])

xlis = []
ans = [None] * (N ** 2)

for i in range(N):
    ans[x[i]-1] = i+1
    xlis.append([x[i],i+1])

xlis.sort()

for i in range(N):

    for j in range(xlis[i][1]-1):
        mustuse.append(xlis[i][1])

#print (ans)
#print (mustuse)

for i in range(N**2):

    if ans[i] != None:

        if mustuse[0] == ans[i]:
            print ("No")
            sys.exit()
        for j in range(N-ans[i]):
            ableuse.append(ans[i])

    else:

        if len(mustuse) > 0:
            ans[i] = mustuse.popleft()

        elif len(ableuse) > 0:
            ans[i] = ableuse.popleft()

        else:
            print ("No")
            sys.exit()

print ("Yes")
print (" ".join(map(str,ans)))

### FIXED CODE ###

from collections import deque
import sys

N = int(input())

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

mustuse = deque([])
ableuse = deque([])

xlis = []
ans = [None] * (N ** 2)

for i in range(N):
    ans[x[i]-1] = i+1
    xlis.append([x[i],i+1])

xlis.sort()

for i in range(N):

    for j in range(xlis[i][1]-1):
        mustuse.append(xlis[i][1])

#print (ans)
#print (mustuse)

for i in range(N**2):

    if ans[i] != None:

        if len(mustuse) > 0 and mustuse[0] == ans[i]:
            print ("No")
            sys.exit()
        for j in range(N-ans[i]):
            ableuse.append(ans[i])

    else:

        if len(mustuse) > 0:
            ans[i] = mustuse.popleft()

        elif len(ableuse) > 0:
            ans[i] = ableuse.popleft()

        else:
            print ("No")
            sys.exit()

print ("Yes")
print (" ".join(map(str,ans)))
h,a = map(int, input().split())

print(math.ceil(h/a))

### FIXED CODE ###

import math

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

print(math.ceil(h / a))
N = int(input())
ans = [0]*(10**9)

for _ in range(N):
    a = int(input())
    if ans[a-1] == 0:
        ans[a-1] += 1
    else:
        ans[a-1] = 0

print(sum(ans))


### FIXED CODE ###

N = int(input())
ans = set()

for _ in range(N):
    a = int(input())
    if not a in ans:
        ans.add(a)
    else:
        ans.remove(a)
print(len(ans))
import sys

H1 = int(sys.stdin.readline())
M1 = int(sys.stdin.readline())
H2 = int(sys.stdin.readline())
M2 = int(sys.stdin.readline())
K = int(sys.stdin.readline())


while not (0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59):
    H1 = int(sys.stdin.readline())
    M1 = int(sys.stdin.readline())
    H2 = int(sys.stdin.readline())
    M2 = int(sys.stdin.readline())
    K = int(sys.stdin.readline())

if M2 >= M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 < M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

### FIXED CODE ###

import sys
readline = sys.stdin.buffer.readline

h1, m1, h2, m2, k = map(int, readline().split())
print(60 * (h2 - h1) + m2 - m1 - k)
n,m=map(int,input().split())
a=[list(map(int,input().split())) for i in range(n)]
ans=[]
xyz=[[1,1,1],[1,1,-1],[1,-1,1],[1,-1,-1],[-1,1,1],[-1,1,-1],[-1,-1,1],[-1,-1,-1]]
for j in xyz:
   x,y,z=j
   lst=[]
   for i in range(m):
      b=a[i][0]*x+a[i][1]*y+a[i][2]*z
      lst+=[b]
   for i in range(m,n):
     b=a[i][0]*x+a[i][1]*y+a[i][2]*z
     if(min(lst)<b):
        lst.remove(min(lst))
        lst+=[b]
   ans+=[sum(lst)]
print(max(ans))
  

### FIXED CODE ###

n,m=map(int,input().split())
a=[list(map(int,input().split())) for i in range(n)]
ans=[]
xyz=[[1,1,1],[1,1,-1],[1,-1,1],[1,-1,-1],[-1,1,1],[-1,1,-1],[-1,-1,1],[-1,-1,-1]]
if(m==0):
  print("0")
else:
 for j in xyz:
   x,y,z=j
   lst=[]
   for i in range(m):
      b=a[i][0]*x+a[i][1]*y+a[i][2]*z
      lst+=[b]
   for i in range(m,n):
      b=a[i][0]*x+a[i][1]*y+a[i][2]*z
      if(min(lst)<b):
         lst.remove(min(lst))
         lst+=[b]
   ans+=[sum(lst)]
 print(max(ans))
import sys
    while 1:
    temp = input()
    if (temp==0):
    break
    N = temp
    a = []
    for i in range(N):
    a.append(map(int, raw_input().split())+[0])
    a.append([0 for i in range(0,temp+1)])	
    for i in range(0,temp):#行に関して
    for j in range(0,temp):#列に関して
    a[i][temp] += a[i][j]
    for k in range(0,temp+1):#列に関して
    for l in range(0,temp):#行に関して
    a[temp][k] += a[l][k]
    for m in range(0,temp+1):
    for n in range(0,temp+1):
    sys.stdout.write(str(a[m][n]).rjust(5))
    print ""
pass

### FIXED CODE ###

import sys
try:
	while 1:
		temp = input()
		if (temp==0):
			break
		N = temp
		a = []
		for i in range(N):
			a.append(map(int, raw_input().split())+[0])
		a.append([0 for i in range(0,temp+1)])
		for i in range(0,temp):
			for j in range(0,temp):
				a[i][temp] += a[i][j]
		for k in range(0,temp+1):
			for l in range(0,temp):
				a[temp][k] += a[l][k]
		for m in range(0,temp+1):
			for n in range(0,temp+1):
				sys.stdout.write(str(a[m][n]).rjust(5))
			print ""
except(RuntimeError):
	pass
X = int(input())
items = range(100, 106)


def cal(x):
    if x == 0:
        print(1)
        exit()

    for i in items:
        if x >= i:
            cal(x-i)


cal(X)
print(0)


### FIXED CODE ###

X = int(input())
for c in range(X//100 + 1):
    if 100*c <= X and X <= 105*c:
        print(1)
        exit()

print(0)
S=input()
if S="SUN":
  print("0")
  elif S="MON":
  print("1")
  elif S="TUE":
  print("2")
  elif S="Wed":
  print("3")
  elif S="THU":
  print("4")
  elif S="FRI":
  print("5")
  elif S="SAT":
  print("6")


### FIXED CODE ###

S=input()
if S=="SUN":
  print(7)
elif S=="MON":
  print(6)
elif S=="TUE":
  print(5)
elif S=="WED":
  print(4)
elif S=="THU":
  print(3)
elif S=="FRI":
  print(2)
elif S=="SAT":
  print(1)
h,w=map(int,input().split())
from math import ceil,floor
if h == 1 or w == 1:
    print(1)
else:
    m = math.ceil(w/2) * math.ceil(h/2) + math.floor(w/2) * math.floor(h/2)
    print(m)

### FIXED CODE ###

from math import floor,ceil
h,w=map(int,input().split())
if h == 1 or w == 1:
    print(1)
else:
    m =ceil(w/2) * ceil(h/2) + floor(w/2) * floor(h/2)
    print(m)
L=int(input())
a=L/3
b=a**3
print(b[:.13f])

### FIXED CODE ###

L=int(input())
a=L/3
b=a**3
print("{:.12f}".format(b))
# ABC111c
from collections import Counter
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)


def calc():
    ans = 0
    for i in range(len(v)):
        if i % 2 == 0:
            if v[i] != f:
                ans += 1
        else:
            if v[i] != f2:
                ans += 1
    return ans


n = int(input())
v = list(map(int, input().split()))
f = Counter(v[::2]).most_common()[0][0]
f2 = Counter(v[1::2]).most_common()[0][0]
if f == f2:
    f2 = Counter(v[1::2]).most_common()[1][0]
    a = calc()
    f = Counter(v[::2]).most_common()[1][0]
    f2 = Counter(v[1::2]).most_common()[0][0]
    print(min(a, calc()))
else:
    print(calc())


### FIXED CODE ###

# ABC111c
from collections import Counter
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)


def calc():
    ans = 0
    for i in range(len(v)):
        if i % 2 == 0:
            if v[i] != f:
                ans += 1
        else:
            if v[i] != f2:
                ans += 1
    return ans


n = int(input())
v = list(map(int, input().split()))
V1 = Counter(v[::2]).most_common()
V2 = Counter(v[1::2]).most_common()
f = V1[0][0]
f2 = V2[0][0]
if f == f2:
    if len(V2) > 1:
        f2 = V2[1][0]
    else:
        f2 = 'x'
    a = calc()
    if len(V1) > 1:
        f = V1[1][0]
    else:
        f = 'x'
    f2 = V2[0][0]
    print(min(a, calc()))
else:
    print(calc())
N = int(input())
if N >= 2 :
    An = [[] for _ in range(1,N)]
    #print(An)
    for s in range(1,N) :
        #print(s)
        if s%3 == 0 :
            An[s] = 0 
        elif s%5 == 0 :
            An[s] = 0
        else:
            An[s] = int(s) 
            #print(s)
            #print(An[s])
    ans = int(sum(An))
else:
    ans = int(1)

print (ans)

### FIXED CODE ###

import numpy as np
N = int(input())
if N >= 2 :
    An = np.zeros(N+2, dtype=np.int)
    #An = [[] for _ in range(1,N+2)]
    #print(An)
    for s in range(1,N+1) :
        #print(s)
        if s%3 != 0 and s%5 != 0 :
            An[s] = int(s) 
            #print(s)
            #print(An[s])
    ans = np.sum(An)

else:
    ans = int(1)

print (int(ans))
n,k =  map(int,input().split())
h = list(map(int,input().split()))

count =	0
for ii in range(n):
    if h[ii] >=	k:
	count += 1

print(count)

### FIXED CODE ###

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

count = 0
for ii in range(n):
    if h[ii] >= k:
        count += 1

print(count)
class Bit:
    def __init__(self, size):
        self.arr = [0] * (size + 1)
        self.size = size

    def read(self, index):
        sum_b = 0
        while index:
            sum_b += self.arr[index]
            index &= index - 1
        return sum_b

    def update(self, index, value=1):
        while index <= self.size:
            self.arr[index] += value
            index += index & -index


bit, a, inv = Bit(int(input())), list(map(int, input().split())), 0

for i in reversed(a):
    inv += bit.read(i)
    bit.update(i)
print(inv)

### FIXED CODE ###

from collections import deque

INFTY = 1e9 + 1


def merge(a, l, m, r):
    global cnt
    ll = deque(a[l:m])
    rl = deque(a[m:r])
    for k in range(l, r):
        if not rl or ll and ll[0] < rl[0]:
            a[k] = ll.popleft()
        else:
            a[k] = rl.popleft()
            cnt += len(ll)


def merge_sort(a, l, r):
    if l + 1 < r:
        m = (l + r) // 2
        merge_sort(a, l, m)
        merge_sort(a, m, r)
        merge(a, l, m, r)


n, a, cnt = int(input()), list(map(int, input().split())), 0
merge_sort(a, 0, n)
print(cnt)
input()
nums = input().split()

maximium = max(nums)
minimium = min(nums)
sums = sum(nums)

print(maximium, minimium, sums)

### FIXED CODE ###

input()
nums = [int(i) for i in input().split()]

maximum = max(nums)
minimum = min(nums)
total = sum(nums)

print(minimum, maximum, total)
from collections import deque

def main():
    q =deque()
    H = 0
    for i in range(int(2e+06)):
        cmd = map(str,raw_input().split())
        if cmd[0] == "insert":
            q.append(int(cmd[1]))
            H += 1
            increase(q,H)
        elif cmd[0] == "extract":
            print q.popleft()
            H -= 1
            buildMaxHeap(q,H)
        else:
            break

def increase(A,i):
    p = i/2
    if 0 < p:
        if A[p-1] < A[i-1]:
            v = A[p-1]
            A[p-1] = A[i-1]
            A[i-1] = v
            increase(A,p)
            
def maxHeapify(A,i,H):
    l = 2*i
    r = 2*i+1
    if l <= H and A[l-1] > A[i-1]:
        largest = l
    else:
        largest = i
    if r <= H and A[r-1] > A[largest-1]:
        largest = r

    if largest != i:
        v = A[i-1]
        A[i-1] = A[largest-1]
        A[largest-1] = v
        maxHeapify(A,largest,H)

def buildMaxHeap(A,H):
    for j in range(H/2):
        i = H/2-j
        maxHeapify(A,i)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import heapq

def main():
    q = []
    while(True):
        cmd = map(str,raw_input().split())
        if cmd[0] == "insert":
            heapq.heappush(q,-int(cmd[1]))
        elif cmd[0] == "extract":
            print -heapq.heappop(q)
        else:
            break

if __name__ == "__main__":
    main()
n = int(input())
lst = [int(x) for x in input().split()]
a = 0
for i in range(n):
    lst[i] = lst[i] - (i + 1)
def sum(k):
    a = 0
    for i in range(n):
        a += abs(lst[i]-k)
    return a
ans = min([sum(lst[int(n/2)]),sum(lst[int(n/2)+1])])
print(str(ans))

### FIXED CODE ###

n = int(input())
lst = [int(x) for x in input().split()]
a = 0
for i in range(n):
    lst[i] = lst[i] - (i + 1)
lst.sort()
def sum(k):
    a = 0
    for i in range(n):
        a += abs(lst[i]-k)
    return a
ans = 0
if ans % 2 == 0:
    ans = min([sum(lst[int(n/2)-1]),sum(lst[int(n/2)])])
else:
    ans = sum(lst[int(n/2)])
print(str(ans))
N = int(input())
A = list(map(int, input().split()))
ans = 1
if 0 in A:
    print(0)
else:
    for i in range(N):
        ans = ans*A[i]
        if(ans > 10*:18):
            print(-1)
            break
        elif(i == N-1):
            print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
ans = 1
if 0 in A:
    print(0)
else:
    for i in range(N):
        a = A[i]
        for j in range(19):
            if a <= 10**j:
                m = j
                break
        for k in range(19):
            if ans <= 10**k:
                n = k
                break
        if(m+n > 19):
            print(-1)
            break
        elif(ans*a == 10**18):
            ans = ans*a
        elif(ans*a > 10**18):
            print(-1)
            break
        else:
            ans = ans*a
        if i == N-1:
            print(ans)
n,k=map(int, input().split())
h=sorted([int(input()) for _ in range(n)])
d=n-k
print(min(h[i+d]-h[i] for i in range(d+1)))


### FIXED CODE ###

n,k=map(int, input().split())
h=sorted([int(input()) for _ in range(n)])
print(min(h[i] - h[i-k+1] for i in range(k-1, n)))
import math
n,b=map(int,input().split())
def kaijo(x):
  return math.factorial(x)

def C(x,y):
  return(kaijo(x)//(kaijo(y)*kaijo(x-y)))

r=n-b
if n==b:
  for i in range(b):
    print(1)
    exit()
for i in range(1,b+1):
  print((C(b-1,i-1)*C(r+1,i))%(10**9+7))


### FIXED CODE ###

import math
n,b=map(int,input().split())
def kaijo(x):
  return math.factorial(x)

def C(x,y):
  if x>=y:
    return(kaijo(x)//(kaijo(y)*kaijo(x-y)))

r=n-b

for i in range(1,b+1):
  if r+1<i:
    print(0)
    continue
  print((C(b-1,i-1)*C(r+1,i))%(10**9+7))
N = int(input())
S = input()

s_list = list(set(S))
n_list = []

for i in range(1, N - 1):
    line1 = S[:i]
    line2 = S[i:]
    num = 0
    for c in s_list:
        _1 = line1.count(c)
        _2 = line2.count(c)
        num += min(_1, _2)
    n_list.append(num)
    
print(max(n_list))

### FIXED CODE ###

N = int(input())
S = input()

s_list = list(set(S))
n_list = []

for i in range(1, N - 2):
    line1 = S[:i]
    line2 = S[i:]
    num = 0
    for c in s_list:
        _1 = line1.count(c)
        _2 = line2.count(c)
        if (_1 > 0 and  _2 > 0):
            num += 1
    n_list.append(num)

if (len(n_list) > 0):
    print(max(n_list))
else:
    print(0)
D,T,S=map(int,input().split)
if D/S<=T:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

D,T,S=map(int,input().split())
if D/S<=T:
    print("Yes")
else:
    print("No")
print('second' if all(a[i] % 2 == 0 for i in range(N)) else 'first')

### FIXED CODE ###

N = int(raw_input())
a = []
for i in range(N):
   a.append(int(raw_input()))
print('second' if all(a[i] % 2 == 0 for i in range(N)) else 'first')