Harryxun/stf_run huggingface dataset:
n = int(input())

graph = [[] for i in range(n)]
edge_cnt = [0] * n
for i in range(n-1):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
    edge_cnt[a-1] += 1
    edge_cnt[b-1] += 1


c = list(map(int, input().split()))
c.sort()

v = 0
for i in range(n):
    if edge_cnt[i] == 1:
        v = i
        break

nodes = [0] * n
total_score = -c[-1]


def dfs(v):
    global total_score
    if nodes[v] > 0:
        return
    nodes[v] = c.pop()
    total_score += nodes[v]
    for nv in graph[v]:
        if nodes[nv] > 0:
            continue
        dfs(nv)


dfs(v)
print(total_score)
print(*nodes, sep=' ')


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

n = int(input())

graph = [[] for i in range(n)]
edge_cnt = [0] * n
for i in range(n-1):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
    edge_cnt[a-1] += 1
    edge_cnt[b-1] += 1


c = list(map(int, input().split()))
c.sort()

v = 0
for i in range(n):
    if edge_cnt[i] == 1:
        v = i
        break

nodes = [0] * n
total_score = -c[-1]


def dfs(v):
    global total_score
    if nodes[v] > 0:
        return
    nodes[v] = c.pop()
    total_score += nodes[v]
    for nv in graph[v]:
        if nodes[nv] > 0:
            continue
        dfs(nv)


dfs(v)
print(total_score)
print(*nodes, sep=' ')
a=int(input("Enter a"))
b=int(input("Enter b"))
c=int(input("Enter c"))
if a-b == b-c || b-a == c-b:
 print("Beautiful")
else:
 print("No")

### FIXED CODE ###

a,b,c = map(int,input().split())
if b-a == c-b:
    print("YES")
else:
    print("NO")
x = int(input(x))
if x == 0:
  print(1)
else:
  print(0)

### FIXED CODE ###

x = int(input())
if x == 0:
  print(1)
else:
  print(0)
N=input()
n=int(N[-1])

if n==2 or n==4 or n==5 n==7 n==9:
  print('hon')
elif n==3:
  print('bon')
else :
  print('pon')

### FIXED CODE ###

N=input()
n=int(N[-1])

if n==2 or n==4 or n==5 or n==7 or n==9:
  print('hon')
elif n==3:
  print('bon')
else :
  print('pon')
N = int(input())
S = list(input())

ans = 0
for i in range(1000):
    if i <= 9:
        if S.count("0") >= 2:
            first = S.index("0")
            SS = S[first+1:]
            second = SS.index("0")
            SSS = SS[second+1]
            if SSS.index(str(i)) == 0:
                continue
            ans += 1
            ##print(i)
        else:
            continue
    elif i <= 99:
        if S.count("0") >= 1:
            first = S.index("0")
            SS = S[first+1:]
            tmp = str(i)
            if SS.count(tmp[0]) == 0:
                continue
            second = SS.index(tmp[0])
            SSS = SS[second+1:]
            if SSS.count(tmp[1]) == 0:
                continue
            ans += 1
            ##print(i)
        else:
    
            continue
    else:
        tmp = str(i)
        ##print(tmp)
        if S.count(tmp[0]) == 0:
            continue
        first = S.index(tmp[0])
        SS = S[first+1:]
        if SS.count(tmp[1]) == 0:
            continue
        second = SS.index(tmp[1])
        SSS = SS[second+1:]
        if SSS.count(tmp[2]) == 0:
            continue
        ##print(i)
        ans += 1

print(ans)

### FIXED CODE ###

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

ans = 0
for i in range(1000):
    if i <= 9:
        if S.count("0") >= 2:
            first = S.index("0")
            SS = S[first+1:]
            second = SS.index("0")
            SSS = SS[second+1:]
            tmp = str(i)
            if SSS.count(tmp) == 0:
                continue
            ans += 1
            ##print(i)
        else:
            continue
    elif i <= 99:
        if S.count("0") >= 1:
            first = S.index("0")
            SS = S[first+1:]
            tmp = str(i)
            if SS.count(tmp[0]) == 0:
                continue
            second = SS.index(tmp[0])
            SSS = SS[second+1:]
            if SSS.count(tmp[1]) == 0:
                continue
            ans += 1
            ##print(i)
        else:
    
            continue
    else:
        tmp = str(i)
        ##print(tmp)
        if S.count(tmp[0]) == 0:
            continue
        first = S.index(tmp[0])
        SS = S[first+1:]
        if SS.count(tmp[1]) == 0:
            continue
        second = SS.index(tmp[1])
        SSS = SS[second+1:]
        if SSS.count(tmp[2]) == 0:
            continue
        ##print(i)
        ans += 1

print(ans)
H, W = map(int, input().split())
S = [list(input()) for _ in range(H)]

ds = [(1, 0), (-1, 0), (0, 1), (0, -1)]

for i in range(H):
    for j in range(W):
        if S[i][j] == ".":
            continue

        flag = False
        for dx, dy in ds:
            x, y = i + dy, j + dx
            if x < 0 or W <= x or y < 0 or H <= y:
                continue

            if S[x][y] == "#":
                flag = True
                break

        if not flag:
            print("No")
            exit()
print("Yes")


### FIXED CODE ###

H, W = map(int, input().split())
S = [list(input()) for _ in range(H)]

d = [(-1, 0), (1, 0), (0, -1), (0, 1)]

for i in range(H):
    for j in range(W):
        if S[i][j] == ".":
            continue

        flag = False
        for dx, dy in d:
            i2, j2 = i+dx, j+dy
            if not (0 <= i2 < H and 0 <= j2 < W):
                continue

            if S[i2][j2] == "#":
                flag = True

        if not flag:
            print("No")
            exit()
print("Yes")
import sys

x = y = 0.000
for i in sys.stdin():
    a, b, c, d, e, f = map(int, i.split())
    y = ((c * d) - (a * f)) / ((b * d) - (a * e))
    x = (c - (b * y)) / a
    print '{0:.3f} {1:.3f}'.format(x, y)

### FIXED CODE ###

while 1:
    try:
        i = raw_input()
        a, b, c, d, e, f = map(float, i.split())
        y = ((c * d) - (a * f)) / ((b * d) - (a * e))
        x = (c - (b * y)) / a
        print "%.3f %.3f" % (x, y)
    except:
        break
a,b = map(int,input().split())
print(min({a+b,a-b,a*b})

### FIXED CODE ###

a,b = map(int,input().split())
print(max(a+b,max(a-b,a*b)))
N,M = map(int,input().split())
edge = [0]*M
for i in range(M):
    a,b,c=map(int,input().split())
    a -= 1
    b -= 1
    c *= -1
    edge[i] = (a,b,c)

inf = float('inf')
V = N
E = M
def shortest_path(s,d):
    for i in range(V):
        for j in range(E):
            From,To,cost = edge[j]
            if d[From] != inf and d[To]>d[From]+cost:
                d[To]=d[From]+cost                
    return d
d = [inf]*V
d[0] = 0
d = shortest_path(0,d)
d_ = shortest_path(0,d)
if d[N-1]!=d_[N-1]
    print('inf')
else:
    print(-d[N-1])

### FIXED CODE ###

N,M = map(int,input().split())
edge = [0]*M
for i in range(M):
    a,b,c=map(int,input().split())
    a -= 1
    b -= 1
    c *= -1
    edge[i] = (a,b,c)

inf = float('inf')
V = N
E = M
d = [inf]*V
d[0] = 0
for i in range(V):
    for j in range(E):
        From,To,cost = edge[j]
        if d[From] != inf and d[To]>d[From]+cost:
            d[To]=d[From]+cost
ans = d[N-1]
for i in range(V):
    for j in range(E):
        From,To,cost = edge[j]
        if d[From] != inf and d[To]>d[From]+cost:
            d[To]=d[From]+cost

if d[N-1]!=ans:
    print('inf')
else:
    print(-ans)
import numpy
n = int(input())

test = list(map(int, input().split()))
answer = []

for i in range(n-1):
    right = sum(test[:i+1])
    left = sum(test[i+1:])
    answer.append(abs(right-left))
print(min(answer))

### FIXED CODE ###

import numpy

n = int(input())

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

right=numpy.cumsum(test)
left=numpy.cumsum(test[::-1])[::-1]

diff = []

for i in range(n-1):
    diff.append(abs(right[i]-left[i+1]))
print(min(diff))
N=int(input())
T=[]
for i in range(N):
    T.append(int(input()))
import math
def lcm(a,b):
    return a*b//math.gcd(a,b)
if N==1:
    print(T[0])
elif N==2:
    print(lcm(T[0],T[1]))
else:
    l=[T[0]]
    for i in range(N-1):
      l.append(lcm(l[i],T[i+1]))
    print(l[-1])

### FIXED CODE ###

N=int(input())
T=[]
for i in range(N):
    T.append(int(input()))
def gcd(a,b):
    if b>a:
        a,b=b,a
    while b>0:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
if N==1:
    print(T[0])
elif N==2:
    print(lcm(T[0],T[1]))
else:
    l=[T[0]]
    for i in range(N-1):
      l.append(lcm(l[i],T[i+1]))
    print(l[-1])
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,k = iim()
A = iil()
d = {}
l = [0]
def move(num):
    if d.get(A[num]-1,False):
        return len(l)
    else:
        d[A[num]-1] = True
        l.append(A[num]-1)
        return move(A[num]-1)

rep = move(0)
mod = k%rep
#print(l,mod)
print(l[mod+1]+1)

### FIXED CODE ###

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
import sys 
sys.setrecursionlimit(10000000)


n,k = iim()
A = iil()
d = {0:True}
l = [0]
def move(num):
    l.append(A[num]-1)
    if d.get(A[num]-1,False):
        return True if A[num]-1 == 0 else False
    else:
        d[A[num]-1] = True
        return move(A[num]-1)

if move(0):
    rep = len(l)-1
    ini = 0
else:
    ini = l.index(l[-1])
    rep = len(l)-ini-1

if k <= ini:
    print(l[k]+1)
else:
    mod = (k-ini)%rep
    if mod == 0:
        mod = rep
#    print(l,mod,rep,ini)
    print(l[ini+mod]+1)
n,q = map(int,input().split())

class Node(object):
	def __init__(self, num):
		self.num = num #各ノードの数字0〜9
		self.children = []
		self.c = 0
	#heapq.heapify()する際に必要となる比較関数
	def __lt__(self, x):
		return self.value < x.value
	#子どもをセットする
	def setChildren(self, x):
		self.children.append(x)
	def solve(self,x):
		self.c += x
		for child in self.children:
			table[child].solve(x)


table = [Node(i+1) for i in range(n)]
counter = [0 for _ in range(n)]

for i in range(n-1):
	a,b = map(int,input().split())
	table[a-1].setChildren(b-1)

for i in range(q):
	p,x = map(int,input().split())
	counter[p-1] += x

for i in range(n):
	if counter[i] != 0:
		table[i].solve(counter[i])

ans = [str(table[i].c) for i in range(n)]
print(" ".join(ans))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7) #追加

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

counter = [0 for _ in range(n)]
E = [[] for _ in range(n)]

#辺の定義
#辺E(u,v)の重みがw
for _ in range(n-1):
  a,b = map(int,input().split())
  a -= 1
  b -= 1
  E[b].append(a)
  E[a].append(b)

for i in range(q):
	p,x = map(int,input().split())
	counter[p-1] += x

res = 0
#行ったかどうか
color = [-1 for _ in range(n)]

#dfsで色を塗っていく
stack = [0]
color[0] = counter[0]
while stack:
  u = stack.pop()
  for v in E[u]:
    if color[v] == -1:
      stack.append(v)
      color[v] = color[u] + counter[v]

ans = [str(color[i]) for i in range(n)]
print(" ".join(ans))
import math
a,b = input().split()
n = b.find('.')
if n > 0:
  bi = int(b[:n])
  bf = int(b[n+1:])
else:
  bi,bf = int(b),0
  
ans = str(math.floor(int(a)*(bi*100+bf)))
N = ans.find('.')
if N > 0:
  ai = int(ans[:n-2])
else:
  ai = int(int(ans)/100)
print(ai)

### FIXED CODE ###

import numpy as np
N = int(input())
list = list(map(int,input().split()))
ans = np.prod(list)
if ans > 10**18 or ans == 0:
  ans = -1
if 0 in list:
  ans = 0
print(ans)
A, B, T = input().sprit()
print(int(T/A)*B)

### FIXED CODE ###

A, B, T = map(int, input().split())
print(int(T/A)*B)
s=input()
n=len(s)
for i in range(n//2):
    if s[2*i]=="L":
        print("No")
        break
else:
    for j in range((n+1)//2):
        if s[2*i+1]=="R":
            print("No")
            break
    else:print("Yes")

### FIXED CODE ###

s=input()
n=len(s)
p=0
for i in range(n):
  if i%2==0:
    if s[i]=="L":
      p=1
  else:
    if s[i]=="R":
      p=1
if p==0:
  print("Yes")
else:
  print("No")
o = input()
e = input()

for x,y in zip_longest(o, e, fillvalue=""):
  print(x+y,end="")

### FIXED CODE ###

from itertools import zip_longest

o = input()
e = input()

for x,y in zip_longest(o, e, fillvalue=""):
  print(x+y,end="")
n, k = map(int, input().split())
td = list(sorted([tuple(map(int, input().split())) for _ in range(n)], key=lambda td: -td[1]))
td2 = []
eaten = set()
dup = 0
score = k * k
i = 0
j = 0
while len(eaten) + dup < k:
    if td[i][0] in eaten:
        td2.append(td[i])
        i += 1
    else:
        diff = (k - dup) * (k - dup) - (k - dup - 1) * (k - dup - 1)
        if i < n and (j >= len(td2) or td[i][1] >= td2[j][1] - diff):
            t, d = td[i]
            score += d
            eaten.add(t)
            i += 1
        else:
            t, d = td2[j]
            score += d - diff
            dup += 1
            j += 1
print(score)


### FIXED CODE ###

n, k = map(int, input().split())
td = list(sorted([tuple(map(int, input().split())) for _ in range(n)], key=lambda td: -td[1]))
td2 = []
eaten = set()
dup = 0
score = k * k
i = 0
j = 0
while len(eaten) + dup < k:
    if i < n and td[i][0] in eaten:
        td2.append(td[i])
        i += 1
    else:
        diff = (k - dup) * (k - dup) - (k - dup - 1) * (k - dup - 1)
        if i < n and (j >= len(td2) or td[i][1] >= td2[j][1] - diff):
            t, d = td[i]
            score += d
            eaten.add(t)
            i += 1
        else:
            t, d = td2[j]
            score += d - diff
            dup += 1
            j += 1
print(score)
n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7

mia, pla = [], []
for ai in a:
    if ai < 0:
        mia.append(ai)
    elif ai >= 0:
        pla.append(ai)
mia.sort(reverse=True)
pla.sort()

cnt = 1
if len(pla) == 0 and k % 2 == 1:
    for i in mia[:k]:
        cnt = cnt * i % mod
    print(cnt)
else:
    while k > 0:
        if len(mia) <= 1:
            if len(pla) == 0:
                cnt = cnt * mia.pop() % mod
            elif len(pla) > 0:
                cnt = cnt * pla.pop() % mod
                k -= 1
        elif len(pla) <= 1:
            cnt = cnt * mia.pop() * mia.pop() % mod
            k -= 2
        elif len(pla) >= 2 and len(mia) >= 2:
            if pla[-1] * pla[-2] > mia[-1] * mia[-2]:
                cnt = cnt * pla.pop() % mod
                k -= 1
            elif pla[-1] * pla[-2] <= mia[-1] * mia[-2]:
                cnt = cnt * mia.pop() * mia.pop() % mod
                k -= 2
    else:
        print(cnt)


### FIXED CODE ###

#with open('random_pm00.txt') as f:
    #n, k = map(int, f.readline().split())
    #a = list(map(int, f.readline().split()))
n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7

mia, pla = [], []
for ai in a:
    if ai < 0:
        mia.append(ai)
    elif ai >= 0:
        pla.append(ai)
mia.sort(reverse=True)
pla.sort()

cnt = 1
if len(pla) == 0 and k % 2 == 1:
    for i in mia[:k]:
        cnt = cnt * i % mod
else:
    while k > 0:
        if k == 1 or len(mia) <= 1:
            if len(pla) == 0:
                cnt = cnt * mia.pop() % mod
            elif len(pla) > 0:
                cnt = cnt * pla.pop() % mod
            k -= 1
        elif len(pla) <= 1:
            if k == 1:
                cnt = cnt * pla.pop() % mod
                k -= 1
            elif k > 1:
                cnt = cnt * mia.pop() * mia.pop() % mod
                k -= 2
        elif len(pla) >= 2 and len(mia) >= 2:
            if pla[-1] * pla[-2] > mia[-1] * mia[-2]:
                cnt = cnt * pla.pop() % mod
                k -= 1
            elif pla[-1] * pla[-2] <= mia[-1] * mia[-2]:
                cnt = cnt * mia.pop() * mia.pop() % mod
                k -= 2
print(cnt)
N = int(input())
S = []
for i in range(N):
    S.append(input())

def check(S, A, B):
    for i in range(N):
        for j in range(i+1, N):
            # if j + B < N:
            #     b = j + B
            # else:
            #     b = j + B - N
            # if i + B < N:
            #     d = i + B
            # else:
            #     d = i + B - N
            if S[i][j+B] != S[j][i+B]:
                return 0
    return 1

cnt = 0
for i in range(N):
    cnt += check(S, 0, i)
print(cnt * N)

### FIXED CODE ###

N = int(input())
S = []
for i in range(N):
    S.append(input())

def check(S, A, B):
    for i in range(N):
        for j in range(i+1, N):
            if S[i][j] != S[j][i]:
                return 0
    return 1

cnt = 0
for i in range(N):
    cnt += check(S[i:] + S[:i], 0, i)
print(cnt * N)
n = int(input())

before = int(input())
current = int(input())
diffMax = current - before
for i in range(n - 1):
  number = int(input())
  diff = number - current
  diffMax = max(diff, diffMax)
  current = min(current, number)
print(diffMax)



### FIXED CODE ###

n = int(input())

value1 = int(input())
value2 = int(input())
maxDiff = value2 - value1
minValue = min(value1, value2)
for i in range(n - 2):
  value = int(input())
  diff = value - minValue
  maxDiff = max(diff, maxDiff)
  minValue = min(value, minValue)
print(maxDiff)
n,i = map(int(),input().split())
print(n-i+1)

### FIXED CODE ###

n,i = map(int,input().split())
print(n-i+1)
if __name__ == "__main__":
    N, K = [int(n) for n in input().split()]
    h = [int(n) for n in input().split()]
    # dp[i]はi番目までたどり着くのに必要な最小コスト
    # dp[0] = 0
    # dp[1] = |h[1] - h[0]|
    # dp[i] = min(dp[0]+h[i]-h[0], dp[1]+h[i]-h[1], ...)
    dp = [0] * int(10)
    dp[0] = 0
    dp[1] = abs(h[1] - h[0])
    for i in range(2, N):
        minimum = 1e10
        stop = K + 1
        if i - K < 0:
            stop = i + 1
        for k in range(1, stop):
            cost = dp[i - k] + abs(h[i] - h[i-k])
            if cost < minimum:
                minimum = cost
        # print(ary)
        print(dp)
        print("--")
        dp[i] = minimum
    print(dp[N-1])


### FIXED CODE ###

def a():
    N, K = [int(n) for n in input().split()]
    h = [int(n) for n in input().split()]
    # dp[i]はi番目までたどり着くのに必要な最小コスト
    # dp[0] = 0
    # dp[1] = |h[1] - h[0]|
    # dp[i] = min(dp[0]+h[i]-h[0], dp[1]+h[i]-h[1], ...)
    dp = [0] * N
    dp[0] = 0
    dp[1] = abs(h[1] - h[0])
    for i in range(2, N):
        dp[i] = min([dp[k] + abs(h[k] - h[i]) for k in range(max(i - K, 0), i)])
    print(dp[N-1])

if __name__ == "__main__":
    a()
ans = ""
if N == 1:
    print("1")
elif N == -1:
    print("10")
else:
    while True:
        r = N % 2
        N = (N-r) /-2
        ans = str(int(r)) + ans
        if N == 0 or N == 1:
            ans = str(int(N)) + ans
            break

    print(ans)

### FIXED CODE ###

import math
N = int(input())

ans = ""
if N == 1:
    print("1") 
elif N == 0:
    print("0")  
elif N == -1:
    print("10")
else:
    while True:
        r = N % 2
        N = (N-r) /-2
        ans = str(int(r)) + ans
        if N == 0 or N == 1:
            ans = str(int(N)) + ans
            break

    print(ans)
n, k = map(int, input().split())
a = list(map(int, input().split()))
total_1 = 0
for i in range (n - 1):
    for j in range (i, n):
        if a[i] > a[j]:
            total_1 += 1
total_2 = 0
for i in range (n):
    for j in range (i):
        if a[i] > a[j]:
            total_2 += 1
def factorial(n):
    total = 0
    while(n > 0):
        total += n
        n -= 1
    return total

print(total_1 * K + total_2 * factorial(K - 1))

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
total_1 = 0
for i in range (n - 1):
    for j in range (i + 1, n):
        if a[i] > a[j]:
            total_1 += 1
total_2 = 0
for i in range (n):
    for j in range (n):
        if a[i] > a[j]:
            total_2 += 1
print((total_1 * k + (total_2 * k * (k - 1)) // 2) % (10 ** 9 + 7))
n = int (input())
a = [input() for _ in range(n)]
if ( a(i) != a(i+1) ):
  print("Yes")
else:
  print("No")


### FIXED CODE ###

n = int(input())
a = set(map(int, input().split()))
ans = "YES"
if len(a) != n: #setは重複させないから。
  ans = "NO"
  
print(ans)
N, M = map(int, input().split())
H = list(map(int, input().split()))
AB = [[] for i in range(M)]
for i in range(M):
    AB[i] = list(map(int, input().split()))

cnt = 0
memo_loser = []
for bridge in AB:
    

    value = min(H[bridge[0]-1], H[bridge[1]-1])
    if value == H[bridge[0]-1] and not bridge[0] in memo_loser:
        memo_loser.append(bridge[0])
    if value == H[bridge[1] - 1] and not bridge[1] in memo_loser:
        memo_loser.append(bridge[1])
print(N - len(memo_loser))


### FIXED CODE ###

S = input()
if S == "ABC":
  print("ARC")
else:
  print("ABC")
N = int(input())
s = [0] * N
d = {"M": 0, "A": 0, "R": 0, "C": 0, "H": 0}
for i in range(N):
    s[i] = input()
    if s[i][0] == "M":
        d['M'] += 1
    elif s[i][0] == "A":
        d['A'] += 1
    elif s[i][0] == "R":
        d['R'] += 1
    elif s[i][0] == "C":
        d['C'] += 1
    elif s[i][0] == "H":
        d['H'] += 1

total = 1
count = 0
del_keys = []
for k, v in d.items():
    if v == 0:
        del_keys.append(k)
    else:
        total *= v
        count += 1

for key in del_keys:
    del d[key]

if count < 3:
    print(0)
    exit()
elif count == 3:
    print(total)
    exit()
elif count == 4:
    ans = 0
    for k, v in d.items():
        ans += total / v
    print(ans)
    exit()
elif count == 5:
    ans = 0
    d_lst = list(d)
    for i in range(4):
        for j in range(i+1, 5):
            ans += total / (d_lst[i] * d_lst[j])
    print(ans)


### FIXED CODE ###

from collections import Counter
from itertools import combinations

n = int(input())
s = [input()[0] for _ in range(n)]
lc = Counter(s)

con = []
for c in 'MARCH':
    if c in lc:
        con.append(lc[c])

ans = 0
for a, b, c in combinations(con, 3):
    ans += a * b * c

print(ans)
s = input()
pirnt(s.count('1'))

### FIXED CODE ###

s = input()
print(s.count('1'))
from sys import setrecursionlimit
setrecursionlimit(10 ** 9)
import heapq as q

n, m = [int(i) for i in input().split()]
A = [[int(i) for i in input().split()] for j in range(n + m - 1)]

T = [[] for i in range(n+1)]
RT = [[] for i in range(n+1)]

for a, b in A:
    T[a].append(b)
    RT[b].append(a)

D = [0] * (n+1)
P = [0] * (n+1)
used = [False] * (n+1)

def bfs(p):
    Q = []
    q.heappush(Q, (-1, 0, p))
    while Q:
        depth, p, v = Q.heappop(Q)
        if used[v]:
            continue
        used[v] = True
        D[v] = depth
        P[v] = p
        for t in T[v]:
            q.heappush(Q, (depth - 1, p, t))

def root(i):
    if not RT[i]:
        return i
    return root(RT[i][0])

bfs(root(1))
for p in P[1:]:
    print(p)

### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(10 ** 9)

n, m = [int(i) for i in input().split()]
A = [[int(i) for i in input().split()] for j in range(n + m - 1)]

T = [[] for i in range(n+1)]
RT = [set() for i in range(n+1)]

for a, b in A:
    T[a].append(b)
    RT[b].add(a)

D = [0] * (n+1)
P = [0] * (n+1)
used = [0] * (n+1)

def dfs(p, i, depth):
    if used[i]:
        return None
    D[i] = depth
    P[i] = p
    used[i] = True
    for t in tuple(T[i]):
        RT[t].remove(i)
    for t in tuple(T[i]):
        if not RT[t]:
            dfs(i, t, depth+1)

def root(i):
    if not RT[i]:
        return i
    return root(tuple(RT[i])[0])

dfs(0, root(1), 1)
for p in P[1:]:
    print(p)
X=input()
if X >= 30:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

X=int(input())
if X >= 30:
  print('Yes')
else:
  print('No')