Harryxun/stf_run huggingface dataset:
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N - 1)]
# N = 9
# AB = [[1, 2], [2, 3], [9, 8], [8, 3], [3, 4], [4, 5], [3, 6], [6, 7]]
if N == 2:
    print(1, 2)
    exit()
if N == 3:
    print(1, 2, 3)
    exit()


class Node:
    def __init__(self, v):
        self.linked = set()
        self.v = v

    def add_node(self, node):
        self.linked.add(node)

    def set_rank(self, parent, rank):
        self.rank = rank
        for node in self.linked:
            if node == parent:
                continue
            node.set_rank(parent=self, rank=rank + 1)

    def __repr__(self):
        return '{}'.format(self.rank)


nodes = {v: Node(v) for v in range(1, N + 1)}
for a, b in AB:
    nodes[a].add_node(nodes[b])
    nodes[b].add_node(nodes[a])

# usokaihou
import random

root = nodes[random.randint(1, N)]
root.set_rank(None, 0)

group = [[], [], []]
for node in nodes.values():
    group[node.rank % 3].append(node)
group.sort(key=len)
result = {}
x1 = set()
x2 = set()
x3 = set()

for i in range(1, N + 1):
    if i % 3 == 1:
        x1.add(i)
    elif i % 3 == 2:
        x2.add(i)
    else:
        x3.add(i)

for node in group[0]:
    result[node.v] = x3.pop()

for node in group[1]:
    if x2:
        result[node.v] = x2.pop()
    elif x3:
        result[node.v] = x3.pop()
    else:
        result[node.v] = x1.pop()

for node in group[2]:
    if x1:
        result[node.v] = x1.pop()
    elif x2:
        result[node.v] = x2.pop()
    else:
        result[node.v] = x3.pop()

print(' '.join(str(result[i]) for i in range(1, N + 1)))


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000000)
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N - 1)]


class Tree:
    def __init__(self, v):
        self.v = v
        self.neighbors = []

    def set_rank(self, rank, parent):
        self.rank = rank
        for neighbor in self.neighbors:
            if neighbor is parent:
                continue
            neighbor.set_rank(rank=rank + 1, parent=self)


trees = {i: Tree(i) for i in range(1, N + 1)}

for a, b in AB:
    trees[a].neighbors.append(trees[b])
    trees[b].neighbors.append(trees[a])
try:
    trees[1].set_rank(1, None)
except:
    print(-1)
    exit()

group0 = [node.v for node in trees.values() if node.rank % 2 == 0]
group1 = [node.v for node in trees.values() if node.rank % 2]
x = [set(), set(), set()]
for i in range(1, N + 1):
    x[i % 3].add(i)
if len(group1) < len(group0):
    group1, group0 = group0, group1
result = {}
if len(group0) <= len(x[0]):
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    y = x[0] | x[1] | x[2]
    while group1 and y:
        result[group1.pop()] = y.pop()
else:
    while x[2] and group0:
        result[group0.pop()] = x[2].pop()
    while x[1] and group1:
        result[group1.pop()] = x[1].pop()
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    while group1 and x[0]:
        result[group1.pop()] = x[0].pop()
    if group0 or group1:
        print(-1)
        exit()

print(' '.join(str(result[i]) for i in range(1, N + 1)))
a = int (input())
if a>81:
  print("No")
else:
  c = 1
  for i in range(7):
    b = a/(9-i)
    print(b)
    
    if b.is_integer()==True and b<10:
      c = 0
      print(c)
    else:
      c = c*1
      print(c)
if c==0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a = int (input())  

if a>81:
  print("No")
else:
  c = 1
  for i in range(9):
    b = a/(9-i)
    
    if b.is_integer()==True and b<10:
      c = 0
    else:
      c = c*1
  if c==0:
    print("Yes")
  else:
    print("No")
s=input()

op_n=len(s) - 1

ans=0

for i in range(1 << len(s)):
  sign = [""] * op_n
  for j in range(op_n):
    if ((i>>j) and 1)==1:
      sign[j] = "+"
  formula = ""
  for k in range(op_n):
    formula += s[k] + sign[k]
  formula += s[op-n] 
  ans += eval(formula)
print(ans)  
    
      
       

### FIXED CODE ###

s = input()

op_n = len(s) - 1

ans = 0

for i in range(1 << op_n):
  sign = [""] * op_n
  for j in range(op_n):
    if ((i>>j)&1):
      sign[j] = "+"
  formula = ""
  for k in range(op_n):
    formula += s[k] + sign[k]
  formula += s[op_n] 
  ans += eval(formula)
print(ans)
a = input()
b = input()
 
c = round((a+b)/2)
 
print(int(c))

### FIXED CODE ###

S=((input())).split(' ')
print((int)(((int)(S[0])+(int)(S[1]))/2+0.5))
n = input()
print('Yes' if len(set(list(n[:3]))) == 1 or len(set(list(n[1:4]))) == 1 'No')

### FIXED CODE ###

n = input()
print('Yes' if len(set(n[:3])) == 1 or len(set(n[1:4])) == 1 else 'No')
N = input()
str = input()
str_list=list(str)
ans_list=[]
for i in range N:
  str_first = str_list[0:i+1]
  str_second = str_list[i:]
  answer = set(str_first) & set(str_second)
  ans_list.append(answer)
  
print(max(ans_list))

### FIXED CODE ###

N = int(input())
str = input()
str_list=list(str)
ans_list=[]
for i in range (N):
  str_first = str_list[0:i+1]
  str_second = str_list[i+1:]
  answer = len(list(set(str_first) & set(str_second)))
  ans_list.append(answer)
  
print(max(ans_list))
N = int(input())
ListH = list(map(int,input().split()))
result = 1
for i in range(N):
    for k in range(i):
        out = False
        if k >= 0:
            if ListH[k] > ListH[i]:
                out = True
    if not out :
        result += 1
print(result)

### FIXED CODE ###

a, b = map(int,input().split())
if a > b:
  c = a
  a-=1
else:
  c = b
  b-=1
if a > b:
  c += a
else:
  c += b
print(c)
def convert_binary(n):
    if n == 0:
        return '0'
    s = []
    while True:
        s.append(str(n % 2))
        n = int(n / 2)
        if n == 0:
            break
    return ''.join(s)[::-1]

def calc_xor(bs):
    maxlen = max([len(b) for b in bs])
    for i in range(len(bs)):
        bs[i] = '0' * (maxlen - len(bs[i])) + bs[i]
    s = ''
    for i in range(maxlen):
        if (sum([int(b[i]) for b in bs])) % 2 == 1:
            s += '1'
        else:
            s += '0'
    return s

def convert_decimal(binary):
    n = 0
    i = 0
    for b in binary[::-1]:
        n += (2 ** i) * int(b)
        i += 1
    return n
  
A, B = list(map(int, input().split(' ')))

print(convert_decimal(calc_xor([convert_binary(i) for i in list(range(A, B + 1))])))

### FIXED CODE ###

def convert_binary(n):
    if n == 0:
        return '0'
    s = []
    while True:
        s.append(str(n % 2))
        n = int(n / 2)
        if n == 0:
            break
    return ''.join(s)[::-1]
   
def calc_xor(b1, b2):
    maxlen = max(len(b1), len(b2))
    b1 = '0' * (maxlen - len(b1)) + b1
    b2 = '0' * (maxlen - len(b2)) + b2
    s = ''
    for i in range(maxlen):
        if (int(b1[i]) + int(b2[i])) % 2 == 1:
            s += '1'
        else:
            s += '0'
    return s
   
def convert_decimal(binary):
    n = 0
    i = 0
    for b in binary[::-1]:
        n += (2 ** i) * int(b)
        i += 1
    return n
 
def calc_xor_from_zero(n):
    if (n+1) % 2 == 0:
        count_pair = int((n+1) / 2)
        if count_pair % 2 == 0:
            return '0'
        else:
            return '1'
    else:
        count_pair = int((n+1) / 2)
        if count_pair % 2 == 0:
            return calc_xor('0', convert_binary(n))
        else:
            return calc_xor('1', convert_binary(n))
    
A, B = list(map(int, input().split(' ')))
 
print(convert_decimal(calc_xor(calc_xor_from_zero(A-1), calc_xor_from_zero(B))))
s = int(input())

ans=0

def f(n):
  if (n % 2 == 0):
    return f(n /2)
  else:
    return f(3*n + 1)
  
while (True):
  a_n = [s]
  if (a_n.count(4) != 2):
    a_n.append(f(s))
  else:
    index = a_n.index(4)
    ans = a_n[index+3]
    break
    
print(ans)
  
  
  



### FIXED CODE ###

s = int(input())
 
ans = 0
 
if (s == 1 or s == 2 or s == 4):
  print(4)
else:
  while (s != 4):
    if (s % 2 == 0):
      s  =  int(s/2)
    else:
      s = 3*s + 1
    ans += 1
  
 
  print(ans+4)
A,B,C = input().split()

if A[len(A)-1]==B[0] and B[len(B)-1]==C[0]:
  print("YES)
else:
  print("NO")

### FIXED CODE ###

A,B,C = input().split()

if A[len(A)-1]==B[0] and B[len(B)-1]==C[0]:
  print("YES")
else:
  print("NO")
input_line1 = raw_input()
c = 1
p = ""
for v in input_line1:
    if c == 1:
        p += v
        c = 0
    else:
        c += 1

### FIXED CODE ###

input_line1 = str(input())
c = 1
p = ""
for v in input_line1:
    if c == 1:
        p += v
        c = 0
    else:
        c += 1
print(p)
put D

### FIXED CODE ###

D, T, S = input().split()
sum_price = int(T) * int(S)
if int(D) <= sum_price:
  print("Yes")
else:
  print("No")
#encoding=utf-8
def solve(n):
    k = len(n)
    c = str(n)[k - 1]
    if str(n)[1..k] = '9' * k:
        return c + 9 * (k - 1)
    return c + 9 * (k - 1)  - 1

if __name__ == "__main__":
    n = int(input())
    print(solve(n))


### FIXED CODE ###

#encoding=utf-8
def solve(n):
    ans_a = calc_digit_sum(n)
    ans_b = calc_digit_sum(n - n % 10 - 1)
    ans_c = calc_digit_sum(10 ** (len(str(n)) - 1) - 1 + 10 ** (len(str(n)) - 1) * (int(str(n)[0]) - 1) )
    return max(ans_a, ans_b, ans_c)

def calc_digit_sum(n):
    if n <= 0:
        return 0
    str_n = str(n)
    ans = 0
    for x in range(len(str_n)):
        ans = ans + int(str_n[x])
    return ans

if __name__ == "__main__":
    n = int(input())
    print(solve(n))
X = input()

for j in range(len(X//2)):
    X = X.replace('ST', '')
    if 'ST' not in X:
        break

print(len(X))

### FIXED CODE ###

X = input()
s = cnt = 0

for i in range(len(X)):
    if X[i] == 'S':
        s += 1
    elif s != 0:
        cnt += 2
        s -= 1

ans = len(X) - cnt
print(ans)
n, mm, q = map(int,input().split())
a, b, c, d = [0]*q, [0]*q, [0]*q, [0]*q
for i in range(q):
    a[i],b[i],c[i],d[i] = map(int,input().split())
import itertools
td = []
ttd = []

m = []
for i in range(1,mm+1):
    m.append(i)

s = list(itertools.combinations(m, n))
for j in range(len(s)):
    for i in range(q):
        if s[j][b[i]-1] - s[j][a[i]-1] == c[i]:
            td.append(d[i])
    ttd.append(sum(td))
    td = []
print(max(ttd))
    

### FIXED CODE ###

n, mm, q = map(int,input().split())
a, b, c, d = [0]*q, [0]*q, [0]*q, [0]*q
for i in range(q):
    a[i],b[i],c[i],d[i] = map(int,input().split())
import itertools
td = []
ttd = []

m = []
for i in range(1,mm+1):
    m.append(i)

s = list(itertools.combinations_with_replacement(m, n))
for j in range(len(s)):
    for i in range(q):
        if s[j][b[i]-1] - s[j][a[i]-1] == c[i]:
            td.append(d[i])
    ttd.append(sum(td))
    td = []
if ttd==[]:
    print(0)
else:
    print(max(ttd))
N = int(input())
K = int(input())
h = [int(a) for a in input().split()]
ans = 0
for i in range(N):
  if h[i] >= K:
    ans += 1
    
print(ans)

### FIXED CODE ###

NK = [int(a) for a in input().split()]
h = [int(a) for a in input().split()]
ans = 0
for i in range(NK[0]):
  if h[i] >= NK[1]:
    ans += 1
    
print(ans)
A = []
A = list(map(int, input().split()))
s = A.sort()[0]
m = A.sort()[1]
l = A.sort()[2]
count = 0
difs = l-s
difm = l-m
count += difs//2 + difm//2
if difs%2 == 0 and difm%2 == 0:
  print(count)
elif difs%2 == 0 and difm%2 == 1:
  count += 2
  print(count)
else:
  count += 1
  print(count)
  


### FIXED CODE ###

A = [int(i) for i in input().split()]
A.sort()
s,m,l = A
count = 0
ls = l-s
lm = l-m
count += ls//2
count += lm//2
if ls%2 == 0 and lm%2 == 0:
  print(count)
  exit()
elif ls%2 == 1 and lm%2 == 1:
  count += 1
  print(count)
else:
  count += 2
  print(count)
s=set(input())
a=[]
for i in s:
  a.append(ord(i)-ord("a"))
for i in range(26):
  if i not in a:
    print(chr(i+ord("a"))
    break

### FIXED CODE ###

s=set(input())
a=[]
for i in s:
  a.append(ord(i)-ord("a"))
for i in range(26):
  if i not in a:
    print(chr(i+ord("a")))
    break
if len(a)==26:
  print("None")
a = int(input())
s = input()
if a >= 3200:
	pint(s)
else:
	print('red')


### FIXED CODE ###

a = int(input())
s = input()
if a >= 3200:
	print(s)
else:
	print('red')
class UnionFind():
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.size = [1 for i in range(n)]

    def find(self, x):
        if self.par[x] != x:
            self.par[x] = self.find(self.par[x]) # contraction
        return self.par[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if not self.same(x, y):
            self.size[y] += self.size[x]
        self.par[x] = y

    def same(self, x, y):
        return self.find(x) ==  self.find(y)

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

uf = UnionFind(n)
ans = n * (n-1) // 2
anss = []
for i in reversed(range(m)):
    anss.append(ans)
    # print(uf.par)
    # print(uf.size, [uf.size[uf.find(i)] for i in range(n)])
    a, b = edge[i]
    if not uf.same(a, b):
        ans -= uf.size[uf.find(a)] * uf.size[uf.find(b)]
    # print(i, a, b)

    uf.unite(a, b)

for i in reversed(range(m)):
    print(anss[i])


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)


class UnionFind():
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        if self.par[x] != x:
            self.par[x] = self.find(self.par[x]) # contraction
        return self.par[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if not self.same(x, y):
            self.size[y] += self.size[x]
        self.par[x] = y

    def same(self, x, y):
        return self.find(x) == self.find(y)


n, m = map(int, input().split())
edge = [list(map(lambda x: int(x) - 1, input().split())) for _ in range(m)]

uf = UnionFind(n)
ans = n * (n-1) // 2
anss = []
for i in reversed(range(m)):
    anss.append(ans)
    # print(uf.par)
    # print(uf.size, [uf.size[uf.find(i)] for i in range(n)])
    a, b = edge[i]
    if not uf.same(a, b):
        ans -= uf.size[uf.find(a)] * uf.size[uf.find(b)]
    # print(i, a, b)

    uf.unite(a, b)

for i in reversed(range(m)):
    print(anss[i])
S = input()
s = {"A", "T", "C", "G"}
low = []
for i in range(len(S)):
    if S[i] in s:
        low.append(i)
high = []
for i in reversed(range(len(S))):
    if S[i] in s:
        high.append(i)

ans = []
for i in low:
    for j in high:
        if (set(S[i:j+1]) - s) == set():
            ans.append(len(S[i:j+1]))

print(max(ans))

### FIXED CODE ###

S = input()
N = len(S)
s = {"A", "T", "C", "G"}

ans = 0
for i in range(N):
    for j in range(i, N):
        if all([c in s for c in S[i:j+1]]):
            ans = max(ans, j-i+1)
print(ans)
# お約束
INF = float("inf")
MOD = int(1e9 + 7)

N, Q = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N - 1)]
PX = [list(map(int, input().split())) for _ in range(Q)]

sum_val = [0] * N
for p, x in PX:
	p, x = p - 1, x
	sum_val[p] += x

edges = [[] for _ in range(N)]
for a, b in AB:
	a, b = a - 1, b - 1
	edges[a] += [b]
	edges[b] += [a]

visited = [False] * N
vals = [0] * N

def dfs(v, p, add_val):
	global visited, vals
	visited[v] = True
	vals[v] = add_val + sum_val[v]
	for n in edges[v]:
		if visited[n]: continue
		dfs(n, v, add_val + sum_val[v])

dfs(0, -1, 0)
for v in vals:
	print(v)


### FIXED CODE ###

import sys
from math import factorial, ceil, floor
from bisect import bisect_right as bsr
from operator import itemgetter as ig
from collections import defaultdict as dd
from collections import deque

# お約束
args = None
INF = float("inf")
MOD = int(1e9 + 7)
def int1(n):
    return int(n) - 1
def input():
    return next(args)
def parse(*params):
    if len(params) == 1:
        return params[0](next(args))
    return tuple(p(v) for p, v in zip(params, next(args).split()))
def debug(*v):
    if __debug__:
        print(*v, file=sys.stderr)

# エントリーポイント
def main():
    N, Q = parse(int, int)
    edges = [[] for _ in range(N)]
    for _ in range(N - 1):
        a, b = parse(int1, int1)
        edges[a] += [b]
        edges[b] += [a]
    vals = [0] * N
    for _ in range(Q):
        p, x = parse(int1, int)
        vals[p] += x

    counter = [0] * N
    que = [(0, 0)]
    alr = [False] * N
    while que:
        v, x = que.pop()
        alr[v] = True
        counter[v] += x + vals[v]
        for n in edges[v]:
            if not alr[n]:
                que.append((n, counter[v]))

    for v in counter:
        print(v)

if __name__ == '__main__':
    args = iter(sys.stdin.read().split("\n"))
    main()
N = int(input())

str_list = [input() for i in range(N)]

cnt_dict = {}

for str in str_list:
    s_str = "".join(sorted(str))
    if s_str not in cnt_dict.keys():
        cnt_dict[s_str] = 1
        continue
    cnt_dict[s_str] += 1

from math import factorial

total = 0
for key in cnt_dict.keys():
    cnt = cnt_dict[key]
    if cnt < 2:
        continue
    total += factorial(cnt) / factorial(2) / factorial(cnt - 2)

print(int(total))


### FIXED CODE ###


N = int(input())

cnt_dict = {}

for i in range(N):
    s_list = list(input())
    s_list.sort()
    s_str = "".join(s_list)
    if s_str not in cnt_dict.keys():
        cnt_dict[s_str] = 1
        continue
    cnt_dict[s_str] += 1

import itertools
comb = itertools.combinations

total = 0
for key in cnt_dict.keys():
    cnt = cnt_dict[key]
    if cnt < 2:
        continue
    total += cnt * (cnt - 1) // 2

print(total)
# input = sys.stdin.readline
from bisect import *
from collections import *
from heapq import *
import copy
K=int(input())
A=list(map(int,input().split()))
if A[-1]!=2:
    print(-1)
    exit()

maX=2
miN=2
Amax=2

for i in range(K-1,-1,-1):

    if A[i]//maX>=2 or A[i]>(maX//A[i+1])*A[i+1]+maX%A[i+1]:
        print(-1)
        exit()
    if A[i]//miN>=2:
        miN=A[i]
    if miN%A[i]==0:
        pass
    else:
        miN=(miN//A[i] +1) *A[i]

    if maX%A[i]==0:
        maX=(maX//A[i]) *A[i] + A[i]-1
    else:
        maX=(maX//A[i]) *A[i] + A[i]-1
    Amax=max(A[i],Amax)

print(miN,maX)


### FIXED CODE ###

# input = sys.stdin.readline
from bisect import *
from collections import *
from heapq import *
import copy
K=int(input())
A=list(map(int,input().split()))
if A[-1]!=2:
    print(-1)
    exit()

maX=2
miN=2

for i in range(K-1,-1,-1):

    if A[i]//maX>=2:
        print(-1)
        exit()
    if A[i]//miN>=2:
        miN=A[i]
    else:
        if miN%A[i]==0:
            pass
        else:
            miN=(miN//A[i] +1) *A[i]
    maX=maX-maX%A[i] + A[i]-1

mmaX=maX
for i in range(K):
    mmaX-=mmaX%A[i]
if mmaX==2:
    print(miN,maX)
else:
    print(-1)
x,t = map(int, input().split())
if x > t:
  print(x-t)
else:
  print(0

### FIXED CODE ###

x,t = map(int, input().split())
if x > t:
  print(x-t)
else:
  print(0)
A, B=input().split()
b=float(B)*100
result=int(A)*int(b)
answer=round(result/100,2)
print(int(answer))

### FIXED CODE ###

N=int(input())
s=input().split()
result=1
if '0' in s:
  print(0)
else:
  for i in range (N):
    result=result*int(s[i])
    if result> 10**18:
      print(-1)
      break
    elif i==N-1 and result<=10**18:
      print(result)
, m, k = [int(x) for x in input().split()]
fr = [i for i in range(n)]
dfr = [[] for i in range(n)]
bl = [[] for i in range(n)]
def deref(a):
    s = []
    while True:
        next = fr[a]
        if next == a:
            break
        s.append(a)
        a = next
    for i in s:
        fr[i] = a
    return a

def merge(a, b):
    #print('merge(',a,b)                                                                
    ra, rb = deref(a), deref(b)
    fr[rb] = ra

for i in range(m):
    a, b = [int(x) - 1 for x in input().split()]
    dfr[a].append(b)
    dfr[b].append(a)
    a, b = min(a, b), max(a, b)
    merge(a, b)
for i in range(n):
    deref(i)
#print(dfr)                                                                             
#print(fr)                                                                              
ss = [[] for i in range(n)]
for i in range(n):
    ss[fr[i]].append(i)
for i in range(k):
    c, d = [int(x) - 1 for x in input().split()]
    bl[c].append(d)
    bl[d].append(c)
    for i in range(n):
    bl[i].sort()
r = []
for i in range(n):
    v = len(ss[fr[i]]) - len(dfr[i]) - 1
    v -= sum(fr[j] == fr[i] for j in bl[i])
    r.append(v)
print(' '.join(str(x) for x in r))



### FIXED CODE ###

n, m, k = [int(x) for x in input().split()]
fr = [i for i in range(n)]
dfr = [[] for i in range(n)]
bl = [[] for i in range(n)]
def deref(a):
    s = []
    while True:
        next = fr[a]
        if next == a:
            break
        s.append(a)
        a = next
    for i in s:
        fr[i] = a
    return a
def merge(a, b):
    ra, rb = deref(a), deref(b)
    fr[rb] = ra
for i in range(m):
    a, b = [int(x) - 1 for x in input().split()]
    dfr[a].append(b)
    dfr[b].append(a)
    a, b = min(a, b), max(a, b)
    merge(a, b)
for i in range(n):
    deref(i)
ss = [[] for i in range(n)]
for i in range(n):
    ss[fr[i]].append(i)
for i in range(k):
    c, d = [int(x) - 1 for x in input().split()]
    bl[c].append(d)
    bl[d].append(c)
for i in range(n):
    bl[i].sort()
r = []
for i in range(n):
    v = len(ss[fr[i]]) - len(dfr[i]) - 1
    v -= sum(fr[j] == fr[i] for j in bl[i])
    r.append(v)
print(' '.join(str(x) for x in r))
import math

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

if R == 0: #赤いボールが無い時
    print (1)
    for _ in range(1, K):
        print (0)
    exit()

if K == 1: #青いボールが1つのとき
    print (R+1)
    exit()


# K_1 = math.factorial(K-1)
# R_1 = math.factorial(R+1)
# print (K_1, R_1)
for i in range(1, K+1): #K回答えを出力
    # if i > R:
    #     print (0)
    #     continue
    if i == 1:
        print (R + 1)
        continue
    # print (K_1, R_1, math.factorial(i))
    if i >= 2:
        position = R_1 = math.factorial(R+1)//(math.factorial(i) * math.factorial(R + 1- i))
        boal = math.factorial(K-1)//(math.factorial(i-1) * math.factorial(K - i))
    print ((position * boal)%(7 + 10 ** 9))

### FIXED CODE ###

import math
import sys
sys.setrecursionlimit(10 ** 4)
N, K = map(int, input().split())
R = N - K

if R == 0: #赤いボールが無い時
    print (1)
    for _ in range(1, K):
        print (0)
    exit()

if K == 1: #青いボールが1つのとき
    print (R+1)
    exit()

K_1 = math.factorial(K-1)
R_1 = math.factorial(R+1)
# print (K_1, R_1)
for i in range(1, K+1): #K回答えを出力
    # if i > R:
    #     print (0)
    #     continue
    if i == 1:
        print (R + 1)
        continue
    # print (K_1, R_1, math.factorial(i))
    if i == 2:
        position = R_1//(math.factorial(i) * math.factorial(R + 1- i))
        boal = K_1//(math.factorial(i-1) * math.factorial(K - i))
    if i > 2:
        position = (position * (R + 1 - (i-1))) // i
        boal = (boal * (K - (i-1)))// (i-1)
    print ((position * boal)%(7 + 10 ** 9))
n = raw_input()
if int(n) % sum(map(int, list(n))) == 0:
  print('YES')
else:
  print('NO')


### FIXED CODE ###

n = raw_input()
if int(n) % sum(map(int, list(n))) == 0:
  print('Yes')
else:
  print('No')
import sys
from collections import deque, defaultdict
import copy
import bisect
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 9)

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

num = [0 for i in range(N)]
for i in range(M):
    num[a[i] - 1] = 1000000008
if num[0] == 0:
    num[0] = 1
if num[1] == 0:
    num[1] = 1 + min(1000000007, num[0])
    num[1] = num[1] % 1000000007
for i in range(2, N):
    if num[i] < 1000000008:
        num[i] = min(1000000007, num[i - 1]) + min(1000000007, num[i - 2])
        num[i] = num[i] % 1000000007
print(num[N - 1])

### FIXED CODE ###

import sys
from collections import deque, defaultdict
import copy
import bisect
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 9)

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

num = [0 for i in range(N)]
for i in range(M):
    num[a[i] - 1] = 1000000008
if num[0] == 0:
    num[0] = 1
if len(num) >= 2 and num[1] == 0:
    num[1] = 1 + min(1000000007, num[0])
    num[1] = num[1] % 1000000007
for i in range(2, N):
    if num[i] < 1000000008:
        num[i] = min(1000000007, num[i - 1]) + min(1000000007, num[i - 2])
        num[i] = num[i] % 1000000007
print(num[N - 1])