Harryxun/stf_run huggingface dataset:
N = int(input())
a = list(map(int,(input().split())))
list_a = [0]*2*100001
for i in a:
  list_a[i] += 1
for i in range(1,N+1):
  print(list_a[i])

### FIXED CODE ###

N = int(input())
print(round(N*2*3.1415,2))
n = int(input())
if n%1000 == 0:
    print(0)
else:
print(1000-n%1000)

### FIXED CODE ###

n = int(input())
if n%1000 == 0:
    print(0)
else:
    print(1000-n%1000)
n = int(input())
s = []
for i in range(n):
    s.append(input())
    
dic = dict()
ans = 0
for i in s:
    if "".join(sorted(i)) in dic:
        ans += dic[i]
        dic["".join(sorted(i))] +=1
        print(dic)
    else:
        dic["".join(sorted(i))] = 1
print(ans)

### FIXED CODE ###

n = int(input())
s = []
for i in range(n):
    s.append(input())
    
dic = dict()
ans = 0
for i in s:
    if "".join(sorted(i)) in dic:
        ans += dic["".join(sorted(i))]
        dic["".join(sorted(i))] +=1
    else:
        dic["".join(sorted(i))] = 1
print(ans)
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import sympy as sym
input = sys.stdin.readline
 
# bisect_left(lists, 3)
# bisect_right(lists, 3)

# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

def main():
	N,M = map(int, input().split(" "))
	#N = int(input())
	#S = input()
	#S = list(S)
	
	a = []
	for _ in range(M):
		tmp = int(input())
		if len(a) != 0:
			if tmp-1 == a[-1]:
				print(0)
				sys.exit()
		a.append(tmp)

	if M == 0:
		print(fb(N+1))
		sys.exit()

	base = 0
	ans = 1
	for i, vol in enumerate(a):
		if base == 0:
			ans = ans * fb(vol)
			base = vol
		else:
			ans = (ans% 1000000007) * (fb(vol-base)% 1000000007)
			base = vol

	if N != base:
		ans = (ans% 1000000007) * (fb(N-base)% 1000000007)

	print(ans % 1000000007)


def fb(num):
    """num番目のフィボナッチ数を返す
    """
    a, b = 1, 0
    for _ in range(num):
        a, b = a + b, a
    return b

if __name__ == "__main__":
	main()

### FIXED CODE ###

import sys
import numpy as np
MOD = 1000000007
def main():
    n, m = [int(x) for x in input().split()]
    pattern = [1]
    broken = -1
    brokencnt = 0
    if brokencnt < m:
        broken = int(input())
        brokencnt += 1
    for i in range(1, n + 1):
        if i == broken:
            pattern.append(0)
            if brokencnt < m:
                broken = int(input())
                brokencnt += 1
            continue
        if i == 1:
            pattern.append(pattern[i - 1])
        if i > 1:
            pattern.append((pattern[i - 1] + pattern[i - 2]) % MOD)
    print(pattern[n])
main()
from fractions import gcd
n, m = map(int, input().split())
s = input()
t = input()
l = n * m // gcd(n, m)
a = [""] * (n*m)
for i in range(n):
    a[i*l//n] = s[i]
for i in range(m):
    if a[i*l//m] == "" or a[i*l//m] == t[i]:
        a[i*l//m] = t[i]
    else:
        print(-1)
        exit()
print(l)
 


### FIXED CODE ###

from fractions import gcd
n, m = map(int, input().split())
s = input()
t = input()
g = gcd(n,m)
l = n*m//g
for k in range(g):
    if s[k*n//g] != t[k*m//g]:
        print(-1)
        exit()
print(l)
a=int(input("a"))
b=int(input("b"))
c=a*b
amari=c%2
if amari=0:
  print("Even")
else:
  print("Odd")


### FIXED CODE ###

a, b=map(int, input().split())
c=(a*b)%2
if c==0:
  print("Even")
else:
  print("Odd")
import math

n = int(input())
if n % 2 == 0:
  m = math.ceil(math.log(n, 5))

  ans = 0
  for i in range(1, m+1):
    ans += n // (2*5**i)
  print(ans)
else:
  print(0)

### FIXED CODE ###

import math

n = int(input())
if n == 0:
  print(0)
elif n % 2 == 0:
  m = math.ceil(math.log(n, 5))
  ans = 0
  for i in range(1, m+1):
    ans += n // (2*5**i)
  print(ans)
else:
  print(0)
a = list(map(int,input().split()))
N = a[0]
blue = a[1]
red = a[2]
ans = 0
A = blue + red
X = N // A
Y = N % A
if Y <= blue:
    ans = blue * X + Y
else:
    ans = blue * X + blue
print(ans)

### FIXED CODE ###

S = list(input())
ans = 0

for i in range(0,2):
    if(S[i] != S[i+1]):
        ans = 1
        break
    else :
        ans = 0

if(ans == 1):
    print('Yes')
elif(ans == 0):
    print('No')
def naiseki(x1,y1,z1,x2,y2,z2)
    if x1-x2+y1-y2+z1-z2 == 0:
        print("YES")
    else:
        print("NO")
f = input().split()
try:
    x1=f[0]
    y1=f[1]
    z1=f[2]
    x2=f[3]
    y2=f[4]
    z2=[f5]
    naiseki(x1,y1,z1,x2,y2,z2)
except:
    print("NO")

    

### FIXED CODE ###

n = int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())
    print("YES" if abs((y2-y1)*(x4-x3)-(x2-x1)*(y4-y3)) < 1e-10 else "NO")
import math


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


A, B, C, D = map(int, input().split())

# A以上B以下でCで割り切れる数の個数
x1 = (A-1) // C
x2 = B // C
x = x2 - x1
#print("x:", x)

# A以上B以下でDで割り切れる数の個数
y1 = (A-1) // D
y2 = B // D
y = y2 - y1
#print("y", y)

# A以上B以下でC,Dで割り切れる数の個数
z1 = (A-1) // lcm(C, D)
z2 = B // lcm(C, D)
z = z2 - z1
#print("lcm:{}".format(lcm(C, D)))
#print("z", z)

# A~B間の整数 - Cの倍数とDの倍数の個数 + CでもDでも割り切れる個数
not_d = B - (A+1) - (x + y - z)
print(int(not_d))


### FIXED CODE ###

""" import math


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


A, B, C, D = map(int, input().split())

# A以上B以下でCで割り切れる数の個数
x1 = (A-1) // C
x2 = B // C
x = x2 - x1
#print("x:", x)

# A以上B以下でDで割り切れる数の個数
y1 = (A-1) // D
y2 = B // D
y = y2 - y1
#print("y", y)

# A以上B以下でC,Dで割り切れる数の個数
z1 = (A-1) // lcm(C, D)
z2 = B // lcm(C, D)
z = z2 - z1
#print("lcm:{}".format(lcm(C, D)))
#print("z", z)

# A~B間の整数 - Cの倍数とDの倍数の個数 + CでもDでも割り切れる個数
not_d = B - (A+1) - (x + y - z)
print(int(not_d))
 """

a, b, c, d = map(int, input().split())

total = b - a + 1


def lem(A, B):
	AB = A * B
	while B != 0:
		A, B = B, A % B
	return AB // A


bsep = (b // c) + (b // d) - (b // lem(c, d))
asep = (a-1) // c + (a-1) // d - (a-1) // lem(c, d)

ans = total - bsep + asep
print(ans)
n = input()
  
if n == 'A':
  print('T')
elif n == 'T':
  print('A')
elif n == 'G':
  print('C')
else:
  print('G')

### FIXED CODE ###

n = input()
  
if n == 'A':
  print('T')
elif n == 'T':
  print('A')
elif n == 'G':
  print('C')
else:
  print('G')
n=int(input())
r=[]
for i in range(n):
    a,b=map(int,input().split())
    r.append((a,b))
l=[]
for i in range(n):
    c,d=map(int,input().split())
    l.append((c,d))


r.sort()
l.sort(key=lambda x:x[1],reverse=1)
ans=0
for s,t in r.copy():
    for p,q in l.copy():
        if s<p and t<q:
            ans+=1
            r.remove((s,t))
            l.remove((p,q))
            break
print(ans)

### FIXED CODE ###

from collections import*
n,*a=open(0).read().split()
blue=a[0:int(n)]
red=a[int(n)+1:]
print(max(0,max(v-Counter(red)[k] for k,v in Counter(blue).items())))
a = input()
over = int(a[:2])
under = int(a[2:])
if 0<over<13 and 0<under<13:
   print("AMBIGUOUS")
elif 0<over<13 and (1>under or under>12):
   print("YYMM")
elif(0<under<13 and (1>over or over>12):
   print("MMYY")
else:
   print("NA")

### FIXED CODE ###

a = input()
over = int(a[:2])
under = int(a[2:])
if 0<over<13 and 0<under<13:
   print("AMBIGUOUS")
elif 0<over<13 and (1>under or under>12):
     print("MMYY")
elif 0<under<13 and (1>over or over>12):
     print("YYMM")
else:
     print("NA")
from math import factorial
def cmb(n,r):
  return factorial(n)//(factorial(r)*factorial(n-r))
n=int(input())
s=[input() for i in range(n)]
s.sort()
cnt=0
ans=0
for i in range(1,n):
  if s[i]==s[i-1]:
    cnt+=1
  else:
    ans+=cmb(cnt+1,2)
    cnt=0
print(ans)

### FIXED CODE ###

from math import factorial
def comb(n,k):
  if n<0 or k<0 or n<k:return 0
  if n==0 and k==0:return 1
  a=factorial(n)
  b=factorial(k)
  c=factorial(n-k)
  return a//(b*c)
n=int(input())
s=[sorted(list(input())) for i in range(n)]
s.sort()
cnt=1
ans=0
for i in range(1,n):
  if s[i]==s[i-1]:
    cnt+=1
  else:
    ans+=comb(cnt,2)
    cnt=1
if cnt>=2:
  ans+=comb(cnt,2)
print(ans)
import math
import re
T=input()
x=0
Td=T
d = len(re.sub(r'0', '', Td))
x += math.ceil((d/2+1)*d/2)
spT = T.split('0')
lenT = list(map(len, spT))

#tmpT = '1'*d
tmpX = math.ceil(d/2)
bT = 0
aT = d
tmp = ''
for i in range(len(spT) - 1):
    tmp += spT[i]
    bT += lenT[i]
    aT -= lenT[i]
    if bT % 2==1:
        bT += 1
        if aT % 2 ==1:
            tmpX += 1
        x += tmpX
        tmp += '0'
    else:
        tmp +='+'
tmp += spT[-1]

spT = tmp.split('+')
vT =[]
aT = bT
bT = 0
odT = 0
ccT = 0
for i in range(len(spT)):
    vT.append([len(re.sub(r'0', '', spT[i][::2])), len(re.sub(r'0', '', spT[i][1::2]))])
    odT += vT[-1][0]
    ccT += vT[-1][1]


while len(vT) >1:
    tmpIdx = len(vT)
    tmpL = 0
    tmpMax = 0
    for i in reversed(range(1, len(vT))):
        tmpL += vT[i][1] - vT[i][0]
        if tmpMax  < odT + tmpL:
            tmpIdx = i
            tmpMax = odT + tmpL

    for i in (range(tmpIdx, len(vT))):
        tmpVT = vT[i][1]
        vT[i][1] = vT[i][0]
        vT[i][0] = tmpVT
    odT = tmpMax
    x +=odT
    vT[tmpIdx-1][0] += vT[tmpIdx][0]
    vT[tmpIdx-1][1] += vT[tmpIdx][1]
    del vT[tmpIdx]

print(x)

### FIXED CODE ###

import math
import re
T=input()
x=0
Td=T
d = len(re.sub(r'0', '', Td))
x += math.ceil((d/2+1)*d/2)
spT = T.split('0')
lenT = list(map(len, spT))

tmpX = math.ceil(d/2)
bT = 0
aT = d
tmp = ''
for i in range(len(spT) - 1):
    tmp += spT[i]
    bT += lenT[i]
    aT -= lenT[i]
    if bT % 2==1:
        bT += 1
        if aT % 2 ==1:
            tmpX += 1
        x += tmpX
        tmp += '0'
    else:
        tmp +='+'
tmp += spT[-1]

spT = tmp.split('+')
vT =[]
aT = bT
bT = 0

odT = 0
tmpOd = True

for i in range(len(spT)):
    
    od = len(re.sub(r'0', '', spT[i][0 if tmpOd else 1::2]))
    ev = len(re.sub(r'0', '', spT[i][1 if tmpOd else 0::2]))
    odT += od
    vT.append(od - ev)
    if len(spT[i]) %2 == 1:
        tmpOd = not tmpOd

for i in reversed(range(1, len(spT))):
    odT = odT - vT[i]
    x += odT
    vT[i-1] -= vT[i]


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

a_li.sort()

rem_k = k
for i in range(1, n + 1):
    if rem_k - (n - i) < 0:
        round_index = i - 1
        break
    rem_k -= (n - i)
min_index = rem_k + 1
round_num = a_li[round_index]
del a_li[round_index]

# マイナスの値がある
if a_li[0] < 0:
    ans = round_num * a_li[-1 * (min_index + 1)]
# マイナスの値がない
else:
    ans = round_num * a_li[min_index]

print(ans)


### FIXED CODE ###

import numpy as np

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

zero = a[a==0]
pos = a[a>0]
neg = a[a<0]

l = -10**18
r = 10**18

# 二分探索
# x以下になる組み合わせがいくつあるか計算する
while l+1<r:
    x = (l + r) // 2
    cnt = 0

    # 0になる組み合わせの個数のカウントを追加
    if x >= 0:
        cnt += n * len(zero)

    cnt += a.searchsorted(x//pos,side='right').sum()
    cnt += (n-a.searchsorted(-(-x//neg),side='left')).sum()
    cnt -= np.count_nonzero(a*a<=x)
    cnt//=2

    if cnt >= k:
        r = x
    else:
        l = x

print(r)
n,m=map(int, input().split())
a=list(map(int, input().split()))

from heapq import heappush, heappop
hq=[]

for a_val in a:
    # heappopで最も小さい値が取り出されるため、(-1)をかけて入れる
    heappush(hq, -a)
for _ in range(m):
    heappush(hq, -(heappop(hq)*(-1))//(-2))
print(-sum(hq))

### FIXED CODE ###

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

from heapq import heappush, heappop
hq=[]

for a_val in a:
    # heappopで最も小さい値が取り出されるため、(-1)をかけて入れる
    heappush(hq, -a_val)
for _ in range(m):
    heappush(hq, -(heappop(hq)//(-2)))
print(-sum(hq))
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,K=map(int,input().split())
    def COMinit(n,MOD):
        fac,finv,inv=[0]*(n+1),[0]*(n+1),[0]*(n+1)
        fac[0]=fac[1]=1
        finv[0]=finv[1]=1
        inv[1]=1
        for i in range(2,(n+1)):
            fac[i]=fac[i-1]*i%MOD
            inv[i]=MOD-inv[MOD%i]*(MOD//i)%MOD
            finv[i]=finv[i-1]*inv[i]%MOD
        return fac,finv,inv
    
    def COM(n, k, MOD):
        if n<k or n<0 or k<0:
            return 0
        fac,finv,inv=COMinit(n,MOD)
        return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD
    
    for i in range(K):
        print(COM(K-1,i,MOD)*COM(N-K+1,i+1,MOD)%MOD)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,K=map(int,input().split())
    def COMinit(n,MOD):
        fac,finv,inv=[0]*max(2,n+1),[0]*max(2,n+1),[0]*max(2,n+1)
        fac[0]=fac[1]=1
        finv[0]=finv[1]=1
        inv[1]=1
        for i in range(2,(n+1)):
            fac[i]=fac[i-1]*i%MOD
            inv[i]=MOD-inv[MOD%i]*(MOD//i)%MOD
            finv[i]=finv[i-1]*inv[i]%MOD
        return fac,finv,inv
    
    def COM(n, k, MOD):
        if n<k or n<0 or k<0:
            return 0
        fac,finv,inv=COMinit(n,MOD)
        return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD
    
    for i in range(K):
        print(COM(K-1,i,MOD)*COM(N-K+1,i+1,MOD)%MOD)

if __name__ == '__main__':
    main()
import sys
from collections import deque
input = sys.stdin.readline

def main():
    n, k = map(int, input().split())
    s = list(input())
    
    tank = []
    cnt = 1
    for i in range(1, n):
        if s[i] != s[i-1]:
            tank.append(cnt)
            cnt = 0
        cnt += 1
        if i == n-1:
            tank.append(cnt)
            
    p = len(tank)
    
    if s[0] == '0' and (p+1)//2 <= k:
        print(n)
        exit()
    if p//2 <= k and s[0] == '1':
        print(n)
        exit()
        
    ans = 0
    res = 0
    if s[0] == '0':
        for j in range(2*k):
            res += tank[j]
        ans = res
        for j in range(2*k, p):
            if j == 2*k:
                res -= tank[0]
            elif j%2 == 0:
                res = res - tank[j-2*k] - tank[j*2*k-1]
            res += tank[j]
            ans = max(ans, res)
            
    else:
        for j in range(2*k+1):
            res += tank[j]
        ans = res
        for j in range(2*k+1, p):
            if j%2 == 1:
                res = res - tank[j-2*k-1] - tank[j-2*k]
            res += tank[j]
            ans = max(ans, res)
            
    print(ans)
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
from collections import deque
input = sys.stdin.readline


def main():
    n,k = map(int,input().split())
    s = list(input())

    #tank: '0...0'と'1...1'の塊の数リスト
    #ex. 0001011ならtank = [3,1,1,2] (0が3つ,1が1つ,0が2つ,1が2つ)
    tank = []
    cnt = 1
    for i in range(1,n):
        if s[i] != s[i-1]:
            tank.append(cnt)
            cnt = 0
        cnt += 1
        if i == n-1:
            tank.append(cnt)
    #p:tankの長さ
    p = len(tank)

    #全部1にできてしまう場合
    if s[0] == '0' and (p+1)//2 <= k:
        print(n)
        exit()
    if p//2 <= k and s[0] == '1':
        print(n)
        exit()

    
    ans = 0
    #res:tank[j]が1...1の右端の時の解
    res = 0
    if s[0] == '0':
        for j in range(2*k):
            res += tank[j]
        ans = res
        for j in range(2*k,p):
            if j == 2*k:
                res -= tank[0]
            elif j%2 == 0:
                res= res - tank[j-2*k] -tank[j-2*k-1]
            res += tank[j]
            ans = max(ans,res)

    else:
        for j in range(2*k+1):
            res += tank[j]
        ans = res
        for j in range(2*k+1,p):
            if j % 2 == 1:
                res = res- tank[j-2*k-1]-tank[j-2*k]
            res += tank[j]
            ans = max(ans,res)

    print(ans)

if __name__ == '__main__':
    main()
# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える

N,Q = map(int, input().split())
s = str(input())
T = []
D = []
for i in range(Q):
    t,d = map(str,input().split())
    T.append(t)
    D.append(d)

T.reverse()
D.reverse()

nl = 0
nr = N-1
L = []#回収できた分
R = []
for i in range(Q):
    if D[i]=="R":
        if s[nr] == T[i]:
            L.append(s[nr])
            nr -= 1
        elif len(R)>0:
            if R[-1] == T[i]:
                R.pop()
                nr += 1

    else:
        if s[nl] == T[i]:
            R.append(s[nl])
            nl += 1
        elif len(L)>0:
            if L[-1] == T[i]:
                L.pop()
                nl -= 1

print(N-len(R)-len(L))



#
# print(N-len(L)-len(R))


### FIXED CODE ###

# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える

N,Q = map(int, input().split())
s = input()
td = [input().split() for i in range(Q)]

td.reverse()

nl = 0
nr = N-1
L = []
R = []
for i in td:#全ての指示
    # print(L,R)
    if i[1]=="L":
        if nl < N:
            if s[nl] == i[0]:
                L.append(i[0])
                nl += 1
            if len(R) != 0:
                if R[-1]==i[0]:
                    R.pop()
                    nr += 1
    else:
        if nr >= 0:
          if s[nr] == i[0]:
            R.append(i[0])
            nr -= 1
        if len(L) != 0:
          if L[-1] == i[0]:
            L.pop()
            nl -= 1

print(N-len(L)-len(R))
A, B, H, M = map(int, input().split())

X, Y = A*math.cos(math.pi*(60*H+M)/360), -A*math.sin(math.pi*(60*H+M)/360)
x, y = B*math.cos(math.pi*M/30), -B*math.sin(math.pi*M/30)

print(math.sqrt((X-x)**2+(Y-y)**2))

### FIXED CODE ###

import math
A, B, H, M = map(int, input().split())
 
X, Y = A*math.cos(math.pi*(60*H+M)/360), -A*math.sin(math.pi*(60*H+M)/360)
x, y = B*math.cos(math.pi*M/30), -B*math.sin(math.pi*M/30)
 
print(math.sqrt((X-x)**2+(Y-y)**2))
H,W = map(int,input().split())
if (H*W) % 2 == 0:
    print(int(H*W/2)
if (H*W) % 2 == 1:
    print(int((H*W+1)/2))

### FIXED CODE ###

H,W = map(int,input().split())
if H != 1 and W != 1:
    if (H*W) % 2 == 0:
        print(int(H*W/2))
    elif (H*W) % 2 == 1:
        print(int((H*W+1)/2))
else:
    print(1)
N = int(input())
ac, wa, tle, re = 0, 0, 0, 0
for _ in range(N):
  S = int(input())
  if S == 'AC':
    ac+=1
  elif S == 'WA':
    wa+=1
  elif S == 'TLE':
    tle+=1
  elif S == 'RE':
    re+=1

print('AC x %d'%ac)
print('WA x %d'%wa)
print('TLE x %d'%tle)
print('RE x %d'%re)

### FIXED CODE ###

N = int(input())

ac, wa, tle, re = 0, 0, 0, 0

for i in range(N):
  S = input()
  if S=='AC':
    ac+=1
  elif S=='WA':
    wa+=1
  elif S=='TLE':
    tle+=1
  elif S=='RE':
    re+=1

print('AC x %d'%ac)
print('WA x %d'%wa)
print('TLE x %d'%tle)
print('RE x %d'%re)
a= map(int,input().split())
print(a//3600+':'+(a%3600)//60+':'+(a%3600)%60)


### FIXED CODE ###

a= int(input())
h = a//3600
m = (a%3600)//60
s = (a%3600)%60
print('%d:%d:%d' % (h, m, s))
S = int(input())
ls = list(S)
if ls[0] == ls[1] or ls[1] == ls[2] or ls[2] == ls[3]:
  print('Bad')
else:
  print('Good')

### FIXED CODE ###

#数字でも文字列として扱える。intにすると左一桁目から0がある場合存在しないものとなるので注意
s = input()
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
  print('Bad')
else:
  print('Good')
# パスカルの三角形
N, K = map(int, input().split())

n = max(K - 1, N - K + 1)
c = [[0] * (n + 1) for _ in range(n + 1)]
c[0][0] = 1
for i in range(1, n + 1):
    ci = c[i]
    ci1 = c[i - 1]
    ci[0] = 1
    for j in range(1, i + 1):
        ci[j] = (ci1[j - 1] + ci1[j]) % 1000000007

result = []
for i in range(1, K + 1):
    result.append(c[K - 1][i - 1] * c[N - K + 1][i] % 1000000007)
print('\n'.join(str(i) for i in result))


### FIXED CODE ###

def main():
    N, K = map(int, input().split())

    c = [[0] * 4000 for _ in range(4000)]
    c[0][0] = 1
    for i in range(1, 4000):
        ci = c[i]
        ci1 = c[i - 1]
        ci[0] = 1
        for j in range(1, i + 1):
            ci[j] = (ci1[j - 1] + ci1[j]) % 1000000007

    def f(n, k):
        return c[n+k-1][k-1]

    for i in range(1, K + 1):
        print((f(K-i, i) * f(N-K-(i-1), i+1)) % 1000000007)


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

arr = [1]
cnt = 1

ans = [0 for i in range(N+1)]
ans[0] = 1

for i in range(N):
  if i == 0:
    s = List[i]
    arr.append(s)
    ans[s] += 1
  else:
    if ans[s-1] == 1:
      b = arr.index(List[s-1])
      break
    else:
      s = List[s-1]
      arr.append(s)
      ans[s] += 1
      
l = len(arr)
c = int( (K-b) % (l-b) )

if K-b > 0:
  print(arr[b+c])
else:
  print(arr[K-1])

### FIXED CODE ###

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

arr = [1]
cnt = 1
b = 10 ** 7
ans = [0 for i in range(N+1)]

for i in range(N):
  if i == 0:
    ans[1] += 1
    s = List[i]
    arr.append(s)    
  else:
    if ans[s] == 1:
      b = arr.index(List[s-1])
      break
    else:
      ans[s] += 1
      s = List[s-1]
      arr.append(s)
            
l = len(arr)
c = int( (K-b) % (l-b) )

if K-b > 0:
  print(arr[b+c])
elif K-b == 0:
  print(arr[b])
else:
  print(arr[K])
import math

n = int(input())
l = list(map(int,input().split()))


def lcm(a, b):
    return int(a * b / math.gcd(a, b))

llcm=1
for i in range(n):
    llcm= lcm(llcm,l[i])

mmax=llcm
fmmax=0
    
for m in range(mmax):
    fm=0
    for i in l:
        fm += m%i
    if fm > fmmax:
        fmmax=fm
print(fmmax)

### FIXED CODE ###

n = int(input())
l = list(map(int,input().split()))

cnt=0
f=0
for i in l:
    f += i-1
print(f)
import numpy as np
x = list(map(float, input().split(' ')))
ans = np.sqrt(pow(x[0]-x[2], 2) + pow(x[1]-x[3], 2))
print("{0:.8f}".format(ans))


### FIXED CODE ###

x = list(map(float, input().split(' ')))
ans = pow((pow(x[0]-x[2], 2) + pow(x[1]-x[3], 2)), 0.5)
print("{0:.8f}".format(ans))
from math import gcd


class Eratosthenes: # エラトステネスの篩
    def __init__(self, N) # 素数リスト生成 O(n*log(log n))
        is_prime = [0, 0] + [1] * (N - 1)
        for i in range(int(N**0.5) + 1):
            if is_prime[i] == 0:
                continue
            for j in range(i * 2, N + 1, i):
                is_prime[j] = 0
        self.prime_list = [i for i, pi in enumerate(is_prime) if pi == 1]


    def factor(self, NUM):  # 高速素因数分解 O(log num)
        PRIME = set()
        for p in self.prime_list:
            if p * p > NUM:
                break
            while NUM % p == 0:
                NUM //= p
                PRIME.add(p)
        if NUM > 1:
            PRIME.add(NUM)
        return PRIME


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

ans = 0
for ai in a:
    ans = gcd(ans, ai)
if ans != 1:
    print(‘not coprime’)
    exit()

era = Eratosthenes(max(a))
num = set()
for ai in a:
    prime = era.factor(ai)
    if len(prime & num) > 0:
        print(‘setwise coprime’)
        break
    num |= prime
else:
    print(‘pairwise coprime’)


### FIXED CODE ###

from math import gcd


def eratosthenes(n):
    prime = []
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if n <= p ** 2:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
    return data


def factorize(N):  # 素因数分解
    for p in prime_list:
        if p * p > N:
            break
        if N % p == 0 and (p in num):
            print('setwise coprime')
            exit()
        while N % p == 0:
            N //= p
            num.add(p)
    if N > 1:
        if N in num:
            print('setwise coprime')
            exit()
        num.add(N)


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

ans = 0
for ai in a:
    ans = gcd(ans, ai)
if ans != 1:
    print('not coprime')
    exit()

prime_list = eratosthenes(10 ** 6)
num = set()
for ai in a:
    factorize(ai)
else:
    print('pairwise coprime')
A = raw_input()
B = raw_input()
C = raw_input()

cnt = {'a': 0, 'b': 0, 'c': 0}
S = {'a': A, 'b': B, 'c': C}
turn = 'a'
print(S)

while True:
	if cnt[turn] >= len(S[turn]):
		break	
	pop = S[turn][cnt[turn]]
	cnt[turn] += 1
	print(turn, pop, cnt)
	
	turn = pop

print(turn)

### FIXED CODE ###

A = input()
B = input()
C = input()

cnt = {'a': 0, 'b': 0, 'c': 0}
S = {'a': A, 'b': B, 'c': C}
turn = 'a'

while True:
	if cnt[turn] >= len(S[turn]):
		break	
	pop = S[turn][cnt[turn]]
	cnt[turn] += 1	
	turn = pop

print(turn.upper())