Harryxun/stf_run huggingface dataset:
import numpy as np
from scipy.special import comb

n = int(input())
a = []
for _ in range(n):
    b = list(map(str,input()))
    a.append(b)

ans = [0]*5

for i in range(n):
    tmp = a[i][0]
    if tmp == "M":
        ans[0] += 1
    elif tmp == "A":
        ans[1] += 1
    elif tmp == "R":
        ans[2] += 1
    elif tmp == "C":
        ans[3] += 1
    elif tmp == "H":
        ans[4] += 1
    else:
        continue

cnt = []
for j in range(len(ans)):
    if ans[j] == 0:
        continue
    else:
        cnt.append(ans[j])
l = 0
for k in range(len(cnt)):
    if cnt[k] > 1:
        l += cnt[k] - 1

cnt.sort()
print(cnt)
if len(cnt) <= 2:
    print(0)
elif len(cnt) == 3:
    print(np.prod(cnt))
elif len(cnt) == 4:
    print((cnt[0]*cnt[1]*cnt[2])+(3*cnt[3]))
else:
    print((cnt[0]*cnt[1]*cnt[2])+(3*cnt[3])+(6*cnt[4]))

### FIXED CODE ###

import itertools

n = int(input())
a = []
for _ in range(n):
    b = list(map(str,input()))
    a.append(b)

ans = [0]*5

for i in range(n):
    tmp = a[i][0]
    if tmp == "M":
        ans[0] += 1
    elif tmp == "A":
        ans[1] += 1
    elif tmp == "R":
        ans[2] += 1
    elif tmp == "C":
        ans[3] += 1
    elif tmp == "H":
        ans[4] += 1
    else:
        continue

cnt = 0
for l in itertools.combinations(ans,3):
    cnt += l[0]*l[1]*l[2]

print(cnt)
n = int(input())
A = [int(input()) for i in range(n)]

def BubbleSort(A,n):
    count = 0
    for i in range(n):
        for j in range(n-1,i,-1):
            if A[j] < A[j-1]:
                A[j], A[j-1] = A[j-1], A[j]
                count += 1
    return A, count

ans, count =  (BubbleSort(A,n))
ans = list(map(str,ans))

print (" ".join(ans))
print (count)

### FIXED CODE ###

n = int(input())
 
numbers = list(map(int, input().split(" ")))
 
cnt = 0
 
for i in range(n):
    for j in range(n - 1, i, -1):
        if numbers[j] < numbers[j - 1]:
            numbers[j],numbers[j - 1] = numbers[j - 1], numbers[j]
            cnt += 1
 
numbers = map(str, numbers)
print(" ".join(numbers))
 
print(cnt)
import sys
sys.setrecursionlimit(10000000)

def check(x, y):
	array[x][y] = "0"
	if array[x + 1][y] == "1" : check(x + 1, y)
	if array[x - 1][y] == "1" : check(x - 1, y)
	if array[x][y + 1] == "1" : check(x, y + 1)
	if array[x][y - 1] == "1" : check(x, y - 1)
	if array[x + 1][y + 1] == "1" : check(x + 1, y + 1)
	if array[x + 1][y - 1] == "1" : check(x + 1, y - 1)
	if array[x - 1][y + 1] == "1" : check(x - 1, y + 1)
	if array[x - 1][y - 1] == "1" : check(x - 1, y - 1)

while True:
	h,w = map(int, raw_input().split())
	if h == 0 and w == 0 : break

	array = []
	array.append(list("$" * (2 + h)))
	for i in range(0, w) : array.append(list("$" + raw_input().replace(" ", "") + "$"))
	array.append(list("$" * (2 + h)))
	
	count = 0
	for i in range(1, h + 1):
		for j in range(1, w + 1):
			if array[i][j] == "1":
				check(i, j)
				count += 1
				
	print count

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

def check(x, y):
	array[x][y] = "0"
	if array[x + 1][y] == "1" : check(x + 1, y)
	if array[x - 1][y] == "1" : check(x - 1, y)
	if array[x][y + 1] == "1" : check(x, y + 1)
	if array[x][y - 1] == "1" : check(x, y - 1)
	if array[x + 1][y + 1] == "1" : check(x + 1, y + 1)
	if array[x + 1][y - 1] == "1" : check(x + 1, y - 1)
	if array[x - 1][y + 1] == "1" : check(x - 1, y + 1)
	if array[x - 1][y - 1] == "1" : check(x - 1, y - 1)

while True:
	h,w = map(int, raw_input().split())
	if h == 0 and w == 0 : break

	array = []
	array.append(list("0" * (2 + h)))
	for i in range(0, w) : array.append(list("0" + raw_input().replace(" ", "") + "0"))
	array.append(list("0" * (2 + h)))
	
	count = 0
	for i in range(1, w + 1):
		for j in range(1, h + 1):
			if array[i][j] == "1":
				check(i, j)
				count += 1
				
	print count
a,op,b=input().split()
print(int(a)+op+int(b))

### FIXED CODE ###

print(eval(input()))
import math
N=int(input())
x=[0 for i in range(N)]
y=[0 for i in range(N)]
p=[]
for i in range(N):
    x[i],y[i]=map(int,input().split())
    p.append((x[i],y[i]))
X,Y,R=0,0,0
def dist(p,q):
    a,b=p
    c,d=q
    return math.sqrt((a-c)**2+(b-d)**2)
if N==2:
    print(dist(p[0],p[1])/2)
    exit()
a=dist(p[1],p[2])
b=dist(p[2],p[0])
c=dist(p[0],p[1])
aa=a*a*(b*b+c*c-a*a)
bb=b*b*(c*c+a*a-b*b)
cc=c*c*(a*a+b*b-c*c)

X=(aa*p[0][0]+bb*p[1][0]+cc*p[2][0])/(aa+bb+cc)
Y=(aa*p[0][1]+bb*p[1][1]+cc*p[2][1])/(aa+bb+cc)
R=dist((X,Y),p[0])
#print(dist((X,Y),p[0]))
#print(dist((X,Y),p[1]))
#print(dist((X,Y),p[2]))
for i in range(3,N):
    if dist((X,Y),p[i])<=R:
        continue
    d=dist((X,Y),p[i])
    nX=(X*(R+d)+p[i][0]*(d-R))/(2*d)
    nY=(Y*(R+d)+p[i][1]*(d-R))/(2*d)
    nR=(R+d)/2
    X,Y,R=nX,nY,nR
print(R)

### FIXED CODE ###

import math
N=int(input())
x=[0 for i in range(N)]
y=[0 for i in range(N)]
p=[]
for i in range(N):
    x[i],y[i]=map(int,input().split())
    p.append((x[i],y[i]))
def dist(p,q):
    a,b=p
    c,d=q
    return math.sqrt((a-c)**2+(b-d)**2)
def check(R):
    Q=[]
    for i in range(N):
        for j in range(i+1,N):
            d=dist(p[i],p[j])/2
            if R<d:
                return False
            h=math.sqrt(R*R-d*d)
            #print(d,h,R)
            nx,ny=(x[j]-x[i],y[j]-y[i])
            nr=math.sqrt(nx**2+ny**2)
            dx,dy=h*nx/nr,h*ny/nr
            mx,my=(x[i]+x[j])/2,(y[i]+y[j])/2
            #print(mx,my)
            #print(dx,dy)
            Q.append((mx+dy,my-dx))
            Q.append((mx-dy,my+dx))
    #print(Q,R)
    for pa in Q:
        flag=1
        for i in range(N):
            #print(pa,i,dist(pa,p[i]),R)
            if dist(pa,p[i])>R+9e-7:
                flag=0
                break
        if flag==1:
            return True
    return False

low=0
high=2000
for line in range(50):
    mid=(low+high)/2
    if check(mid):
        high=mid
    else:
        low=mid
print(mid)
N,M=map(int,input().split())

x=list(range(1,N+1,1))


if N%2==1:
    for i in range(M):
        print(x.pop(0),x.pop(-1))
        
else:
    x_f=x[1:int(N/2+1)]
    x_l=x[int(N/2+1):]
    
    
    count=0
    
    for i in range(M):
        if len(x_f)>1:
            print(x_f.pop(0),x_f.pop(-1))
            count+=1
            
        if count==M:
            break
        
        if len(x_l)>1:
            print(x_l.pop(0),x_l.pop(-1))
            count+=1
            
        if count==M:
            break

### FIXED CODE ###

K=int(input())
A,B=map(int,input().split())

Ans='NG'

for i in range(A,B+1):
    if i%K==0:
        Ans='OK'
        break
        
print(Ans)
d,n = map(int, input().split())
if n <100:
    print(100**d*k)
else:
    print(100**d*101)

### FIXED CODE ###

d,n = map(int, input().split())
if n <100:
    print(100**d*n)
else:
    print(100**d*101)
h, n = map(int, input().split())
a = list(map(int, input().split()))

sum = 0
for i int range(n):
  sum += a[i]

if h <= sum:
  print('YES')
else:
  print('NO')


### FIXED CODE ###

h, n = map(int, input().split())
a = list(map(int, input().split()))
 
sum = 0
for i in range(n):
  sum += a[i]
 
if h <= sum:
  print('Yes')
else:
  print('No')
n,m=map(int,input().split())
l=[]
for i in range(m):
    l.append(list(map(int,input().split())))
l.sort()
xi=0
i=0
x=[None for i in range(10**5)]
while i<m:
    x[l[0][0]]=0
    if l[i][0]==xi:
        if x[l[i][1]]==None:
            x[l[i][1]]=l[i][2]+x[l[i][0]]
            i+=1
        else:
            print('No')
            break
    else:
        xi+=1
if i<m:
    pass
else:
    print('Yes')

### FIXED CODE ###

n,m=map(int,input().split())
graph=[[] for i in range(n+1) ]
dist=[None for i in range(n+1)]
dist[0]=0
result=[True]

for i in range(m):
    l,r,d=(int(i) for i in input().split())
    graph[l].append((r,-d))
    graph[r].append((l,d))
def haba(i):
    if dist[i]== None:
        stack=[]
        dist[i]=0
        stack.append(i)
        while len(stack)!=0 :
            l=stack.pop()
            for r,d in graph[l]:
                b=dist[l]+d
                if dist[r]==None :
                    dist[r]=b
                    stack.append(r)
                elif dist[r]!=b:
                     result[0]=False
                     return
        return 
    else:
        return 

for i in range(n+1):
    haba(i)
if result[0]:
    print('Yes')
else:
    print('No')
a, b, k = map(int, input().split())
da = []
db = []
dc = []
for i in range(1,a+1):
    if a%i == 0:
    	da.append(i)

for j in range(1, b+1):
    if b%j == 0:
    	db.append(j)

for l in da:
    if l in db:
    	dc.append(l)

dc.sort(reverse = True)
print(dc[k])


### FIXED CODE ###

a, b, k = map(int, input().split())
da = []
db = []
dc = []
for i in range(1,a+1):
    if a%i == 0:
    	da.append(i)

for j in range(1, b+1):
    if b%j == 0:
    	db.append(j)

for l in da:
    if l in db:
    	dc.append(l)

dc.sort(reverse = True)
print(dc[k-1])
s=input()
t=[]
for i in s:
    if i=="B" and not len(t):t.pop()
    if i=="0" or i=="1":t.append(i)
print(*t,sep="")

### FIXED CODE ###

s=input()
t=[]
for i in s:
    if i=="B" and len(t)!=0:t.pop()
    if i=="0" or i=="1":t.append(i)
print(*t,sep="")
import numpy as np

N = int(input())

N_list = np.arange(1, N)

N_np   = np.sum(N_list)

print(N_np)

### FIXED CODE ###

N = int(input())

print((N*(N-1))//2)
n = int(input())
cost = 0
points = []
for i in range(n):
    xy = input().split()
    x = int(xy[0])
    y = int(xy[1])
    points.append((x,y))
points.sort()
while len(points) != 0:
    p = points[-1][0] - points[-2][0]
    q = points[-1][1] - points[-2][1]
    xn = points[-1][0] - p
    yn = points[-1][1] - q
    cost +=1
    points.pop()
    print(p, " ", q)
    while len(points) != 0:
        if points[-1][0] == xn and points[-1][1] == yn:
            xn = points[-1][0] - p
            yn = points[-1][1] - q
            points.pop()
        else:
            break

print(cost)
    

### FIXED CODE ###

n = int(input())
if n ==1:
    print( 1)
    exit()
cost = 0
points = []
for i in range(n):
    points.append(list(map(int, input().split())))

points.sort()
dictpq = {}
for i in range(n):
    for j in range(i+1,n):
        p = points[i][0] - points[j][0]
        q = points[i][1] - points[j][1]
        if (p,q) in dictpq:
            dictpq[(p,q)] +=1
        else:
            dictpq[(p,q)] =1
print(n-max(dictpq.values()))
S = int(input())
dp=[1]+[0 for i in range(S)]
i = 3
k=1000000007
while True:
  dp[i]=(dp[i-1]+dp[i-3])%k
  if i == S:
    print(dp[-1])
    break
  i+=1

### FIXED CODE ###

S = int(input())
dp=[1]+[0 for i in range(S)]
i = 3
k=1000000007
if S <3:
  print(0)
else:
  while i <= S:
    dp[i]=(dp[i-1]+dp[i-3])%k
    i+=1
  print(dp[S])
# coding: utf-8
from bisect import bisect_left


def solve(*args: str) -> str:
    x = int(args[0])

    P = [pow(i, 5) for i in range(64)]
    ret = None
    for b, b5 in enumerate(P):
        a5 = x+b5
        like_a = bisect_left(P, a5)
        if like_a < len(P):
            if P[like_a] == a5:
                ret = (like_a, b)
                break

        a5 = abs(x-b5)
        like_a = bisect_left(P, a5)
        if like_a < len(P):
            if P[like_a] == a5:
                ret = (like_a if b5 < x else -like_a, -b)
                break

    return ' '.join(map(str, ret))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))


### FIXED CODE ###

# coding: utf-8
from bisect import bisect_left


def solve(*args: str) -> str:
    x = int(args[0])

    P = [pow(i, 5) for i in range(128)]
    ret = None
    for b, b5 in enumerate(P):
        a5 = x+b5
        like_a = bisect_left(P, a5)
        if like_a < len(P):
            if P[like_a] == a5:
                ret = (like_a, b)
                break

        a5 = abs(x-b5)
        like_a = bisect_left(P, a5)
        if like_a < len(P):
            if P[like_a] == a5:
                ret = (like_a if b5 < x else -like_a, -b)
                break

    return ' '.join(map(str, ret))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))
n = list(input().upper())
charac = []
for j in range(65,65+26):
	m= 0
	for i in range(0,len(n)):
		if ord(n[i]) == j:
			m += 1
	charac.append("{} : {}".format(chr(j),m))

for i in range(0,26):
	print(charac[i])

### FIXED CODE ###

s =""
while True:
    try:
        s += input().lower()
    except:
        break
    
s = list(map(ord,list(s)))
for i in range(ord("a"),ord("z")+1):
    print(chr(i) + " : " + str(s.count(i)))
N = int(input())
ans = 0
for i in range(1,N+1):
  if len(i) % 2 == 1:
    ans += 1
print(ans)

### FIXED CODE ###

N = int(input())
ans = 0
for i in range(1,N+1):
  if len(str(i)) % 2 == 1:
    ans += 1
print(ans)
raw_input()
a = map(int,raw_input().split(" "))
raw_input()
b = map(int,raw_input().split(" "))

result = 0
for i in b:
    if i in a:
        result += 1

print result

### FIXED CODE ###

def hoge(n):
 return n.isdigit();

raw_input()
a = map(int,raw_input().split(" "))
raw_input()
b = map(int,filter(hoge,raw_input().split(" ")))

result = 0
for i in b:
    if i in a:
        result += 1

print result
from sys import stdin

a = list(map(char, input().split()))
b = list(map(char, input().split()))

def rot(a,b):
  if a[0] == b[2]:
    if a[1]==b[1]:
      if a[2]==b[0]:
        return 'YES'
  return 'NO'

print(rot(a,b))

### FIXED CODE ###

from sys import stdin

a = list(input())
b = list(input())

def rot(a,b):
  if a[0] == b[2]:
    if a[1]==b[1]:
      if a[2]==b[0]:
        return 'YES'
  return 'NO'

print(rot(a,b))
import numpy as np
n, m = list(map(int, input().split()))
a = [list(input()) for _ in range(n)]
for i in range(n):
	print("".join(arr[i]))
	print("".join(arr[i]))

### FIXED CODE ###

n, m = list(map(int, input().split()))
a = [list(input()) for _ in range(n)]
for i in range(n):
	print("".join(a[i]))
	print("".join(a[i]))
a,b = map(int,input().split())
c = a*b
if c%2 = 0:
    print('Even')
else :
    print('Odd')

### FIXED CODE ###

a,b = map(int,input().split())
c = a*b
if c%2 == 0:
    print('Even')
else :
    print('Odd')
N = int(input())
max_L = 0
sum_L = 0
for i in range(0, N):
  L = int(input())
  if L > max_L:
    max_L = L
  sum_L += L

if sum_L - max_L > max_L:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N = int(input())
L = [int(s) for s in input().split(" ")]
max_L = 0
sum_L = 0
for l in L:
  if l > max_L:
    max_L = l
  sum_L += l
 
if sum_L - max_L > max_L:
  print("Yes")
else:
  print("No")
n = int(inout())
if n < 1200:
  print('ABC')
elif n < 2800:
  print('ARC')
else:
  print('AGC')

### FIXED CODE ###

n = int(input())
if n < 1200:
  print('ABC')
elif n < 2800:
  print('ARC')
else:
  print('AGC')
a = int(input())
b = int(input())

print(a * b)
print(a ** 2 + b ** 2)

### FIXED CODE ###

a,b = [int(i) for i in input().split()]
print(a*b,a*2+b*2)
def rl(proc=None):
    if proc is not None:
        return proc(sys.stdin.readline())
    else:
        return sys.stdin.readline().rstrip()

def srl(proc=None):
    if proc is not None:
        return map(proc, rl().split())
    else:
        return rl().split()

def fix(a):
    mn = min(a) - 1
    return [x - mn for x in a]

def main():
    N = rl(int)
    p = srl(int)
    a = range(N)
    b = list(reversed(a))
    for i, v in enumerate(p[1:], 1):
        a[v-1] += i
        for j in xrange(v, N):
            a[j] += i
            b[j] -= i
    print " ".join(map(str, fix(a)))
    print " ".join(map(str, fix(b)))

if __name__ == '__main__':
    main()

### FIXED CODE ###

#!/usr/bin/python2
# -*- coding: utf-8 -*-

import sys

def rl(proc=None):
    if proc is not None:
        return proc(sys.stdin.readline())
    else:
        return sys.stdin.readline().rstrip()

def srl(proc=None):
    if proc is not None:
        return map(proc, rl().split())
    else:
        return rl().split()

def go(a, x, y):
    if a[x][y] != '#':
        return []
    r = [(x, y)]
    while True:
        for tx, ty in ((x+1, y), (x, y+1)):
            if 0 <= tx < len(a) and 0 <= ty < len(a[0]) and a[tx][ty] == '#':
                x = tx
                y = ty
                break
        else:
            break
        r.append((x,y))
    return r


def main():
    R, C = srl(int)
    a = []
    for _ in xrange(R):
        a.append(rl())
    b = go(a, 0, 0)
    if not b or b[-1] != (R-1, C-1):
        print "Impossible"
        return
    s = sum(x.count('#') for x in a)
    print "Impossible" if s != len(b) else "Possible"

if __name__ == '__main__':
    main()
import numpy as np

N = int(input())
E = [[] for _ in range(N)]
for i in range(N - 1):
	a, b = map(int, input().split())
	E[a - 1].append(b - 1)
	E[b - 1].append(a - 1)


INF = N + 1
D = [INF] * N

stack = [
	i
	for i in range(N)
	if len(E[i]) == 1
]

for i in stack:
	D[i] = 0

max_d = 0
cnt = 0
while stack:
	nexts = []
	for i in stack:
		if D[i] > max_d:
			D[i] = max_d
		nexts.extend(v for v in E[i] if D[v] == INF)
	max_d += 1
    cnt = len(stacks)
	stack = nexts

Rx2 = max_d * 2 if 1 < cnt else max_d * 2 - 1
print('First' if (Rx2 % 3 != 2) else 'Second')


### FIXED CODE ###

N = int(input())
E = [[] for _ in range(N)]
for i in range(N - 1):
	a, b = map(int, input().split())
	E[a - 1].append(b - 1)
	E[b - 1].append(a - 1)


def farthest(s):
	visited = [False] * N
	stack = [(s, 0)]
	best = s, 0
	while stack:
		i, d = stack.pop()
		visited[i] = True
		if best[1] < d:
			best = i, d
		stack.extend((v, d + 1) for v in E[i] if not visited[v])
	return best

print('First' if (farthest(farthest(0)[0])[1] % 3 != 1) else 'Second')
N=int(input())
S={}
for i in range(N):
  S.add(int(input()))
  
print(len(S))

### FIXED CODE ###

N=int(input())
S=set()
for i in range(N):
  S.add(int(input()))
  
print(len(S))
a = [list(map(int, input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
flag = False
for i in range(3):
    if all(a[i][j] in b for j in range(3)): #bの中にa[i][j]があるかどうか
        flag = True
    if all(a[j][i] in b for j in range(3)):
        flag = True
if all(a[i][i] in b for i in range(3)) or all(a[i][2-i] in b for i in range(3)):
    flag = True
 
if flag:
    print("Yes")
else:
  

### FIXED CODE ###

a = [list(map(int, input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
flag = False
for i in range(3):
    if all(a[i][j] in b for j in range(3)): #bの中にa[i][j]があるかどうか
        flag = True
    if all(a[j][i] in b for j in range(3)):
        flag = True
if all(a[i][i] in b for i in range(3)) or all(a[i][2-i] in b for i in range(3)):
    flag = True
 
if flag:
    print("Yes")
else:
    print("No")
def main():
    k = int(input())
    k1 = k + 1

    sum = 0
    for i in range(1, k1):
        for j in range(1, k1):
            for m in range(1, k1):
                sum += math.gcd(math.gcd(i, j), m)
    print(sum)

main()

### FIXED CODE ###

import math


def main():
    k = int(input())
    k1 = k + 1

    sum = 0
    for i in range(1, k1):
        for j in range(1, k1):
            for m in range(1, k1):
                sum += math.gcd(math.gcd(i, j), m)
    print(sum)

main()
s = input()
 
flag = True
for i in range(s):
  if i%2 == 0 and s[i] == "L":
    flag = False
  if i%2 == 1 and s[i] == "R":
    flag = False
 
if flag:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s = input()
 
flag = True
for i in range(len(s)):
  if i%2 == 0 and s[i] == "L":
    flag = False
  if i%2 == 1 and s[i] == "R":
    flag = False
 
if flag:
  print("Yes")
else:
  print("No")
k = int(input())

for i in list(range(1,10)):
     if k in / i >= 10:
             print("No")
     else:
             print("Yes")

### FIXED CODE ###

k = int(input())
for i in range(1,10):
    if k // i <= 9 and k % i == 0:
       print("Yes")
       exit()
     
print("No")
import numpy as np
from numpy.random import *

def quicksort(array):
    if len(array) < 2:
        return array # ?????¬??±??????
    else:
        pivot = array[0] # ?????°??±??????
        # ???????????????????°???????????????????????????¨?????????
        less = [i for i in array[1:] if i <= pivot]

        # ????????????????????§??????????????????????????¨?????????
        greater = [i for i in array[1:] if i > pivot]

        return quicksort(less) + [pivot] + quicksort(greater)


array = randint(1, 1000, 10) 
sorted_array = quicksort(array)
print(sorted_array[2])
print(sorted_array[1])
print(sorted_array[0])

### FIXED CODE ###

array = []
for _ in range(10):
    array.append(int(input()))

sorted_array = sorted(array,reverse=True)
for i in range(3):
    print(sorted_array[i])
n = int(input())
graph = [[]for i in range(n)]
for i in range(n-1):
    pre = list(map(int,input().split()))
    graph[pre[0]-1].extend([pre[1]-1,pre[2]])
    graph[pre[1]-1].extend([pre[0]-1,pre[2]])
seen = [0 for i in range(n)]
color = [-1 for i in range(n)]

def DFS(x):
    if seen[x] == 1:
        return 0
    else:
        pass
    seen[x] = 1
    for i in range(len((graph[x]))//2):
        if graph[x][2*i+1] % 2 == 0:
            color[graph[x][2*i]] = color[x]
        else:
            color[graph[x][2*i]] = not color[x]

    for i in range(len((graph[x]))//2):
        DFS(graph[x][2*i])

color[0] = True
DFS(0)
for i in range(n):
    print(int(color[i]))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
n = int(input())
graph = [[]for i in range(n)]
for i in range(n-1):
    pre = list(map(int,input().split()))
    graph[pre[0]-1].extend([pre[1]-1,pre[2]])
    graph[pre[1]-1].extend([pre[0]-1,pre[2]])
seen = [0 for i in range(n)]
color = [-1 for i in range(n)]

def DFS(x):
    if seen[x] == 1:
        return 0
    else:
        pass
    seen[x] = 1
    for i in range(len((graph[x]))//2):
        if graph[x][2*i+1] % 2 == 0:
            color[graph[x][2*i]] = color[x]
        else:
            color[graph[x][2*i]] = not color[x]

    for i in range(len((graph[x]))//2):
        DFS(graph[x][2*i])

color[0] = True
DFS(0)
for i in range(n):
    print(int(color[i]))
N, M = map(int, input().split())

A = [input() for _ in range(N)]
B = [input() for _ in range(M)]


def f(i, j):
  for k in range(i, i+M):
    for l in range(j, j+M):
      if A[i+k][j+l] != B[k][l]:
        return False
  return True

def slv():
  for i in range(N-M+1):
    for j in range(N-M+1):
      if f(i, j):
        return 'Yes'
  return 'No'
print(slv())
      


### FIXED CODE ###

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

A = [input() for _ in range(N)]
B = [input() for _ in range(M)]


def f(i, j):
  for k in range(M):
    for l in range(M):
      if A[i+k][j+l] != B[k][l]:
        return False
  return True

def slv():
  for i in range(N-M+1):
    for j in range(N-M+1):
      if f(i, j):
        return 'Yes'
  return 'No'
print(slv())
N,K,C =map(int,input().rstrip().split(" "))
S = input()
kinmu = 0
niti = 0
f = []
b = []
for i in range(N):
  kinmu = 0
  niti = 0
  while kinmu < K and niti < N:
    if S[niti] == "o":
      f.append(niti)
      kinmu += 1
      niti += C
    niti += 1
  kinmu = 0
  niti = N -1
  while kinmu < K and niti > 0:
    if S[niti] == "o":
      b.append(niti)
      kinmu -= 1
      niti -= C
    niti -= 1
b.reverse()
for i in range(K):
  if f[i] == b[i]:
    print(f[i] + 1)

### FIXED CODE ###

N,K,C =map(int,input().rstrip().split(" "))
S = input()
kinmu = 0
niti = 0
f = []
b = []
kinmu = 0
niti = 0
while kinmu < K and niti < N:
  if S[niti] == "o":
    f.append(niti)
    kinmu += 1
    niti += C
  niti += 1
kinmu = 0
niti = N -1
while kinmu < K and niti >= 0:
  if S[niti] == "o":
    b.append(niti)
    kinmu += 1
    niti -= C
  niti -= 1
b.reverse()
for i in range(K):
  if f[i] == b[i]:
    print(f[i] + 1)