Harryxun/stf_run huggingface dataset:
w, h = map(int, raw_input().split())
p = []
q = []
for i in xrange(w):
    p.append(raw_input())
p = map(int, p)
for i in xrange(h):
    q.append(raw_input())
q = map(int, q)

wl = w
hl = h

cost = 0

p.sort()
q.sort()

p.append(10 ** 8)
q.append(10 ** 8)

pc = 0
qc = 0

while(wl + hl - pc - qc> 0):
    if p[pc] < q[qc]:
        cost += (hl - qc + 1) * p[pc]
        pc += 1
    else:
        cost += (wl - pc + 1) * q[qc]
        qc += 1

print cost



### FIXED CODE ###

w, h = map(int, raw_input().split())
p = []
q = []
for i in xrange(w):
    p.append(int(raw_input()))
for i in xrange(h):
    q.append(int(raw_input()))

wl = w
hl = h

cost = 0

p.sort()
q.sort()

p.append(10 ** 8 + 1)
q.append(10 ** 8 + 1)

pc = 0
qc = 0

while(wl + hl - pc - qc> 0):
    if p[pc] < q[qc]:
        cost += (hl - qc + 1) * p[pc]
        pc += 1
    else:
        cost += (wl - pc + 1) * q[qc]
        qc += 1

print cost
N = int(input())
if 0<N<10:
  num = N

if 10=<N<100:
  num = 9

if 100=<N<1000:
  num = 9 + N - 99
  
if 1000=<N<10000:
  num = 9 + 900

if 10000=<N<100000:
  num = 909 + N - 9999

if N==100000:
  num=909+90000
  
print(num)

### FIXED CODE ###

N = int(input())
if 0<N<10:
  num = N
 
if 10<=N<100:
  num = 9
 
if 100<=N<1000:
  num = 9 + N - 99
  
if 1000<=N<10000:
  num = 9 + 900
 
if 10000<=N<100000:
  num = 909 + N - 9999
 
if N==100000:
  num=909+90000
  
print(num)
s=input()
n=len(s)
for i in range(n-1):
    if s[i]=="0" and i%2==0:
        ans+=1
    elif s[i]=="1" and i%2==1:
        ans+=1
ans1=0
for i in range(n-1):
    if s[i]=="1" and i%2==0:
        ans1+=1
    elif s[i]=="0" and i%2==1:
        ans1+=1

print(min(ans,ans1))A

### FIXED CODE ###

s=input()
n=len(s)
ans=0
for i in range(n):
    if s[i]=="0" and i%2==0:
        ans+=1
    elif s[i]=="1" and i%2==1:
        ans+=1
ans1=0
for i in range(n):
    if s[i]=="1" and i%2==0:
        ans1+=1
    elif s[i]=="0" and i%2==1:
        ans1+=1

print(min(ans,ans1))
mport collections
S=[]
N=int(input())
for i in range(N):
    S.append(input())
print(len(collections.Counter(S)))
    

    



### FIXED CODE ###

import collections
S=[]
N=int(input())
for i in range(N):
    S.append(input())
print(len(collections.Counter(S)))
N,X=list(map(int,input().split()))
L=list(map(int,input().split()))
D=0
for i in range(1,N+2):
    D+=L[i-1]
    if D>X:
        break
    else:
        pass
print(i)

### FIXED CODE ###

N,X=list(map(int,input().split()))
L=list(map(int,input().split()))
D=0
i=0
for i in range(1,N+1):
    D+=L[i-1]
    if D>X:
        break       
    elif i==N and D<=X:
        i=N+1
        pass
    else:
        pass
print(i)
n,m = (int(i) for i in input().split())
a = [int(i) for i in input().split()]
x,y,inf = [2,5,5,4,5,6,3,7,6],set(),float("inf")
dp,ans = [0,-inf],[]
def f(i,y):
    num = -inf
    for j in y:
        if i>=j: num = max(num,dp[i-j]+1)
    return num 
for i in a: y.add(x[i-1])
for i in range(2,n+1): dp.append(f(i,y))
a,N = sorted(a)[::-1],n
for i in range(dp[n]):
    for j in a:
        if dp[N-x[j-1]]==dp[N]-1:
            ans.append(str(j))
            N-=x[j-1]
            break
print("".join(ans))

### FIXED CODE ###

n,m = (int(i) for i in input().split())
a = [int(i) for i in input().split()]
x,y,inf = [2,5,5,4,5,6,3,7,6],set(),float("inf")
dp,ans = [0,-inf],[]
def f(i,y):
    num = -inf
    for j in y:
        if i>=j: num = max(num,dp[i-j]+1)
    return num 
for i in a: y.add(x[i-1])
for i in range(2,n+1): dp.append(f(i,y))
a,N = sorted(a)[::-1],n
for i in range(dp[n]):
    for j in a:
        if N>=x[j-1] and dp[N-x[j-1]]==dp[N]-1:
            ans.append(str(j))
            N-=x[j-1]
            break
print("".join(ans))
N = int(input())
xyh = []
for i in range(N):
    xyh.append(list(map(int,input().split())))

for cx in range(101):
    for cy in range(101):
        flag = True
        tmpH = 0
        for i in range(N):
            X = xyh[i][0]
            Y = xyh[i][1]
            h = xyh[i][2]
            if i == 0:
                tmpH = abs(X-cx) + abs(Y-cy) + h
            else:
                if tmpH != abs(X-cx) + abs(Y-cy) + h:
                    flag = False
        if flag:
            answer_cx = cx
            answer_cy = cy
            answer_h = tmpH
            answer_string = str(cx) + " " + str(cy) + " " + str(tmpH)
            break
print(answer_string)

### FIXED CODE ###

N = int(input())

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

xyh_sorted = sorted(xyh, key=lambda x: x[2], reverse=True)

answer = [0, 0, 0]
for cy in range(0, 101):
    for cx in range(0, 101):
        H = xyh_sorted[0][2] + abs(xyh_sorted[0][0] - cx) + abs(xyh_sorted[0][1] - cy)
        flag = True
        for i in range(1,N):
            h2 = max(H - abs(xyh_sorted[i][0] - cx) - abs(xyh_sorted[i][1] - cy), 0)
            if h2 != xyh_sorted[i][2]:
                flag = False
                break
        if flag:
            answer = [cx, cy, H]
            break
    if flag:
        break

answerString = str(answer[0]) + " " + str(answer[1]) + " " + str(answer[2])
print(answerString)
a=[0]
tmp=0
for i in range(1,101):
    tmp+=i
    a.append(tmp)

A,B=map(int,input().split())
print(a[B-A]-B)

### FIXED CODE ###

from itertools import accumulate as acc
a=[i for i in range(1000)]
a=list(acc(a))

A,B=map(int,input().split())
print(a[B-A]-B)
S = input()
K = int(input())
ans = 0

# 先頭と後頭が一致していた場合の例外処理
Sfront = S[0]
Srear  = S[-1]
if Sfront == Srear and K > 1:
    Sleft = S.lstrip(Srear)
    kazu_left = len(S) - len(Sleft)
    ans += int(kazu_left/2)
    
    Sleftright = Sleft.rstrip(Srear)
    kazu_right = len(Sleft) - len(Sleftright)
    ans += int(kazu_right/2)
    
    kazu_wa = len(S) - len(Sleftright)
    ans += int(kazunoko/2) * (K-1)
    
    S = Sleftright
else:
    pass

while len(S) > 0:
    print(S)
    current = S[0]
    Snext = S.lstrip(current)
    kazu = len(S) - len(Snext)
    ans += int(kazu/2) * K
    S = Snext
print(ans)

### FIXED CODE ###

S = input()
K = int(input())
ans = 0

# 先頭と後頭が一致していた場合の例外処理
Sfront = S[0]
Srear  = S[-1]
if Sfront == Srear and K > 1:
    Sleft = S.lstrip(Srear)
    kazu_left = len(S) - len(Sleft)
    ans += int(kazu_left/2)
#     print(ans)
    
    Sleftright = Sleft.rstrip(Srear)
    kazu_right = len(Sleft) - len(Sleftright)
    if kazu_right != 0: # 通常
        ans += int(kazu_right/2)

        kazu_wa = len(S) - len(Sleftright)
        ans += int(kazu_wa/2) * (K-1)

        S = Sleftright
         
    else: # 全部同じ文字の例外
        ans = int(kazu_left * K / 2)
        
        S = ""
else:
    pass

while len(S) > 0:
#     print(S)
    current = S[0]
    Snext = S.lstrip(current)
    kazu = len(S) - len(Snext)
    ans += int(kazu/2) * K
    S = Snext
print(ans)
S = input()
for i in range S:
  if i == "o":
    ans += 100
  if i == "x":
    ans += 0
print(ans)


### FIXED CODE ###

S = input()
ans = 700
for i in S:
  if i == "o":
    ans += 100
  if i == "x":
    ans += 0
print(ans)
from collections import defaultdict

N, P = map(int, input().split())
dic = defaultdict(int)

MAX = int(P**0.5)+1
for p in range(2, MAX):
    while P % p == 0:
        dic[p] += 1
        P //= p
    if P:
        dic[P] += 1

ans = 1
print(dic)1
for p, cnt in dic.items():
    ans *= pow(p, cnt//N)
print(ans)

### FIXED CODE ###

from collections import defaultdict

N, P = map(int, input().split())
dic = defaultdict(int)

MAX = int(P**0.5)+1
for p in range(2, MAX):
    while P % p == 0:
        dic[p] += 1
        P //= p
if P > 1:
    dic[P] += 1

ans = 1
for p, cnt in dic.items():
    ans *= pow(p, cnt//N)
print(ans)
import sys
num = [int(s) for s in sys.stdin.readline().split()]
d = {}
for line in sys.stdin.readlines():
  n = [int(s) for s in line.split()]
  print n
  for s in range(1,n[0]+1):
    if s in d :
      d[n[s]] = d[n[s]]+1
    else :
      d[n[s]] = 1
keys = [k for k, v in d.items() if v == num[0]]
print(len(keys))

### FIXED CODE ###

import sys
num = sys.stdin.readline().split()
d = {}
for line in sys.stdin.readlines():
  n = line.split()
  n.pop(0)
  for s in n:
    if s in d :
      d[s] = d[s]+1
    else :
      d[s] = 1
keys = [k for k, v in d.items() if v == int(num[0])]
print(len(keys))
import fractions

n, m = map(int, input().split())
s = input()
t = input()

l = n*m//fractions.gcd(n, m)

s_dic = {i * l//n + 1: s[i] for i in range(n)}
t_dic = {i * l//m + 1: t[i] for i in range(m)}

dup_idx = set(s_dic.keys) & set(t_dic.keys)

for d in dup_idx:
    if s_dic[d] != t_dic[d]:
        print(-1)
        break
else:
    print(l)


### FIXED CODE ###

import fractions

n, m = map(int, input().split())
s = input()
t = input()

l = n*m//fractions.gcd(n, m)

s_dic = {i * l//n + 1: s[i] for i in range(n)}
t_dic = {i * l//m + 1: t[i] for i in range(m)}

dup_idx = set(s_dic.keys()) & set(t_dic.keys())

for d in dup_idx:
    if s_dic[d] != t_dic[d]:
        print(-1)
        break
else:
    print(l)
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def cmb_mod(N, mod=10**9+7):
    N1 = N + 1
    g1 = [0] * N1
    g2 = [0] * N1
    inv = [0] * N1
    g1[0] = g1[1] = g2[0] = g2[1] = inv[1] = 1

    for i in range(2, N1):
        g1[i] = g1[i-1] * i % mod
        inv[i] = -inv[mod % i ] * (mod//i) % mod
        #inv[i] = pow(g1[i-1], mod-2, mod)
        g2[i] = g2[i-1] * inv[i] % mod

    def cmb(n, a):
        if a < 0 or a > n:
            return 0
        return g1[n] * g2[a] * g2[n-a] % mod
    return cmb

def resolve():
    mod = 10**9 + 7
    S = int(input())

    if S < 3:
        print(0)
        return

    cmb = cmb_mod(S - 3 * 2 + 2)

    ans = 1
    for i in range(2, S//3+1):
        n = S - 3 * i + i - 1
        tmp = cmb(n, i - 1)
        ans = (ans + tmp) % mod
    print(ans)


if __name__ == "__main__":
    resolve()


### FIXED CODE ###

#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def cmb_mod(N, mod=10**9+7):
    N1 = N + 1
    g1 = [0] * N1
    g2 = [0] * N1
    inv = [0] * N1
    g1[0] = g1[1] = g2[0] = g2[1] = inv[1] = 1

    for i in range(2, N1):
        g1[i] = g1[i-1] * i % mod
        inv[i] = -inv[mod % i ] * (mod//i) % mod
        #inv[i] = pow(g1[i-1], mod-2, mod)
        g2[i] = g2[i-1] * inv[i] % mod

    def cmb(n, a):
        if a < 0 or a > n:
            return 0
        return g1[n] * g2[a] * g2[n-a] % mod
    return cmb

def resolve():
    mod = 10**9 + 7
    S = int(input())

    if S < 3:
        print(0)
        return
    elif S < 6:
        print(1)
        return

    cmb = cmb_mod(S - 3 * 2 + 3)

    ans = 1
    for i in range(2, S//3+1):
        n = S - 3 * i + i - 1
        tmp = cmb(n, i - 1)
        ans = (ans + tmp) % mod
    print(ans)


if __name__ == "__main__":
    resolve()
as = map(int, input().split())
 
if sum(as) <= 21:
  print("win")
else:
  print("bust")

### FIXED CODE ###

as_ = map(int, input().split())
 
if sum(as_) <= 21:
  print("win")
else:
  print("bust")
a, b, c, k = [int(i) for i in input().split()]

if k <= a and k - a <= b:
	print(k)
else
	print(a - (k - a - b))

### FIXED CODE ###

a, b, c, k = [int(i) for i in input().split()]

if k <= a and k - a <= b:
	print(k)
else:
	print(a - (k - a - b))
N=int(input())
ls=[int(s) for s in input().split()]
count=0
i=0
while(True):
  if ls[i]%2==1:
    break
  ls[i]=ls[i]//2
  if i<N:
    i+=1
  else:
    count+=1
    i=0    
print(count)


### FIXED CODE ###

N=int(input())
ls=[int(s) for s in input().split()]
count=-1
flag=1
while(flag==1):
  count+=1
  for i in range(N):
    if ls[i]%2==1:
      flag=0
      break
    ls[i]=ls[i]//2
print(count)
S = str(input())
S1 = S[:4] + S[5:7] + S[8:]
S2 = int(S)
if S2 <= 20190430:
    print("Heisei")
else:
    print("TBD")

### FIXED CODE ###

S = str(input())
S1 = S[:4] + S[5:7] + S[8:]
S2 = int(S1)
if S2 <= 20190430:
    print("Heisei")
else:
    print("TBD")
n,m=map(int,input().split())
sc=[list(map(int,input().split())) for range(m)]
for i in range(1,m):
  for j in range(i+1,m+1):
    if sc[i-1][0]==sc[j-1][0] and sc[i-1][1]!=sc[j-1][1]:
      print(-1)
      exit()

for t in range(1,m+1):
  if sc[t][0]>=2 and sc[t][1]==0:
    print(-1)
    exit()

for i in range(1,m):
  for j in range(i+1,m+1):
    if sc[i-1][0]==sc[j-1][0] and sc[i-1][1]==sc[j-1][1]:
      sc.remove(sc[i-1])

ans=[]
sc.sort(key=lambda x:x[0])
for t in range(1,m+1):
  ans.append(sc[t][1])
print(*ans,sep='')

### FIXED CODE ###

n,m=map(int,input().split())
sc=[list(map(int,input().split())) for _ in range(m)]
for i in range(1,m):
  for j in range(i+1,m+1):
    if sc[i-1][0]==sc[j-1][0] and sc[i-1][1]!=sc[j-1][1]:
      print(-1)
      exit()
 
for t in range(1,m+1):
  if n>=2 and sc[t-1]==[1,0]:
    print(-1)
    exit()
 
ans=[0]*n
for t in range(1,m+1):
  if ans[sc[t-1][0]-1]==0:
    ans[sc[t-1][0]-1]+=sc[t-1][1]
    
if ans[0]==0 and n>=2:
  ans[0]=1
print(*ans,sep='')
import sys
stdin = sys.stdin

def li(): return [int(x) for x in stdin.readline().split()]
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return [float(x) for x in stdin.readline().split()]
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(ns())
def nf(): return float(ns())

# nの逆元のリスト
def inv_mod(n:int, mod:int) -> list:
    inv = [0,1]
    for i in range(2,n+1):
        inv.append(mod - ((mod//i)*inv[mod%i]) % mod)
    return inv
       
# nの階乗のリスト
def fact(n:int, mod:int) -> list:
    fac = [1,1]
    res = 1
    for i in range(2,n+1):
        res = res*i%mod
        fac.append(res)
    return fac

# nの階乗の逆元のリスト
def fact_inv(n:int, inv:list, mod:int) -> list:
    facInv = [1,1]
    for i in range(2,n+1):
        facInv.append(facInv[i-1]*inv[i] % mod)
    return facInv
        
# 二項係数
def nCr(n:int, r:int, mod:int, fac:list, facInv:list) -> int:
    if not (0<=r and r<=n):
        return 0
    
    return ((fac[n]*facInv[r]) % mod) * facInv[n-r] % mod

from itertools import accumulate
from collections import Counter

n,a,b = li()
v = li()

v.sort(reverse=True)
v_cum = list(accumulate(v))

ans_cand = []

# 貪欲に最大値を選ぶ
for i in range(a,b+1):
    ans_cand.append(v_cum[i-1] / i)
    
ans = max(ans_cand)
opt_is = []

while ans in ans_cand:
    opt_is.append(a + ans_cand.index(ans))
    ans_cand[ans_cand.index(int(ans))] = 0
    

cnt_v = Counter(v)

# 貪欲最大が何通りできるか考える
MOD = 10**18+1
inv = inv_mod(n, MOD)
fac = fact(n, MOD)
facInv = fact_inv(n,inv, MOD)

pat = 0

for opt_i in opt_is:
    opt_set = v[:opt_i]
    cnt_opt = Counter(opt_set)
    
    temp = 1
    
    for key_op, val_op in cnt_opt.items():
        temp *= nCr(cnt_v[key_op], int(val_op), MOD, fac, facInv)
        
    pat += temp
        
print(ans)
print(pat)

### FIXED CODE ###

# nの逆元のリスト
def inv_mod(n:int, mod:int) -> list:
    inv = [-1,1]
    for i in range(2,n+1):
        inv.append(mod - ((mod//i)*inv[mod%i]) % mod)
    return inv
       
# nの階乗のリスト
def fact(n:int, mod:int) -> list:
    fac = [1,1]
    res = 1
    for i in range(2,n+1):
        res = res*i%mod
        fac.append(res)
    return fac

# nの階乗の逆元のリスト
def fact_inv(n:int, inv:list, mod:int) -> list:
    facInv = [1,1]
    for i in range(2,n+1):
        facInv.append(facInv[i-1]*inv[i] % mod)
    return facInv
        
# 二項係数
def nCr(n:int, r:int, mod:int, fac:list, facInv:list) -> int:
    if not (0<=r and r<=n):
        return 0
    
    return ((fac[n]*facInv[r]) % mod) * facInv[n-r] % mod

N,A,B = map(int, input().split())
V = list(map(int, input().split()))

# 二項係数の準備
MOD = 9007199254740997
inv = inv_mod(N,MOD)
fac = fact(N,MOD)
facInv = fact_inv(N,inv,MOD)

V.sort(reverse=True)

max_avg = sum(V[:A])/A
print(max_avg)

ans = 0
if V[0] == V[A-1]:
    v = V.count(V[A-1])
    u = min(v,B)
    for i in range(A,u+1):
        ans += nCr(v,i,MOD,fac,facInv)

else:
    v_all = V.count(V[A-1])
    v_ch = V[:A].count(V[A-1])
    ans = nCr(v_all,v_ch,MOD,fac,facInv)

print(ans)
while True:
    x,y = raw_input()
    if x == 0 and y == 0:
        break
    if x > y:
        x,y = map(str,(x,y))
        print x + " " + y
    else:
        x,y = map(str,(x,y))
        print y + " " + x

### FIXED CODE ###


while True:
    x,y = raw_input().split()
    x,y = map(int,(x,y))
    if x == 0 and y == 0:
        break
    if x > y:
        x,y = map(str,(x,y))
        print y + " " + x
    else:
        x,y = map(str,(x,y))
        print x + " " + y
n = int(input())
d = {}
for i in range(n):
    s = input()
    d[s] = d[s]+1 if (s in d) else 1
d_sorted = sorted(d.items(), key=lambda x:x[1], reverse=True)
m = d_sorted[0][1]
for i in range(n):
    if d_sorted[i][1]!=m:
        break
    print(d_sorted[i][0])

### FIXED CODE ###

n = int(input())
d = {}
for i in range(n):
    s = input()
    d[s] = d[s]+1 if (s in d) else 1
d_sorted = sorted(d.items(), key=lambda x:x[1], reverse=True)
m = d_sorted[0][1]
result = []
for i in d_sorted:
    if i[1]!=m:
        break
    result.append(i[0])
print(*sorted(result), sep='\n')
import itertools

N, M, Q = list(map(int,input().split()))
numbers = [i for i in range(M)]
array = itertools.combinations(numbers, N)

combinations = [list(map(int,input().split())) for _ in range(Q)]

scores = []
for combi in array:
    score = 0
    for _ in range(Q):
        a, b, c, d = combinations[_]
        a = a - 1
        b = b - 1
        if combi[b] - combi[a] == c:
            score += d
    scores.append(score)
    
print(max(scores))

### FIXED CODE ###

import itertools

N, M, Q = list(map(int,input().split()))
numbers = [i for i in range(1, M+1)]
array = itertools.combinations_with_replacement(numbers, N)

input_data = [list(map(int,input().split())) for _ in range(Q)]

max_score = 0
for A in array:
    score = 0
    for _ in range(Q):
        a, b, c, d = input_data[_]
        a = a - 1
        b = b - 1
        if A[b] - A[a] == c:
            score += d
    if score > max_score:
        max_score = score
    
print(max_score)
s=int(input())
def f(x):
  if x%2==0:
    return x/2
  else:
    return 3*x+1
def lol(n):
  if n>1:
    return f(lol(n-1))
  elif n==1:
    return s
List=[]
for i in range(1000000):
  if lol(i)==2:
    break
  List.append(lol(i))
print(List.index(4)+3)



### FIXED CODE ###

s=int(input())
List=[]
while s not in List:
  List.append(s)
  if s%2==0:
    s=s/2
  else:
    s=3*s+1
print(len(List)+1)
a = map(int, input().split())
print(f'{2 * a * 3.141592653589}')
print(f'{a * a * 3.141592653589}')



### FIXED CODE ###

r = float(input())
p = 3.141592653589
print(p*r*r, 2*p*r)
def list_add(li1, li2):
    return list(map(sum,zip(li1,li2)))
N, M, X = map(int, input().split(" "))
list = []
for i in range(N):
    list.append([int(i) for i in input().split(" ")])
list.sort()
price = 0
knowledge = []
priceList = []
flag = True
for i in range(N):
    if flag:
        price = price + list[i][0]
        if i == 0:
            knowledge = list[0][1: M + 1]
        else:
            tmp2 = [x + y for (x, y) in zip(knowledge, list[i][1:M+1])]
            knowledge = tmp2
        # 全部足しても足りないとき
        if i == N - 1 and min(knowledge) < X:
            print(-1)
            exit()
        # 目標を超えたとき
        if min(knowledge) >= X and flag:
            for j in range(i, -1, -1):
                searchList = [x - y for (x, y) in zip(knowledge, list[j][1: M + 1])]
                if min(searchList) >= X:
                    knowledge = searchList
                    price = price - list[j][0]
            flag = False
for i in range(N):
    if min(list[i][1: M + 1]) >= X and min(priceList) > list[i][0]:
        print(list[i][0])
        exit()
print(price)


### FIXED CODE ###

def list_add(li1, li2):
    return list(map(sum, zip(li1, li2)))


def dfs(price, knowledge, depth):
    if (min(knowledge) >= X):
        ansList.append(price)
    if depth == N:
        return
    dfs(price, knowledge, depth + 1)
    dfs(price+priceList[depth], list_add(KnowList[depth], knowledge), depth+1)


N, M, X = map(int, input().split(" "))
KnowList = [[] for i in range(N)]
priceList = [0] * N
for i in range(N):
    tmp = [int(i) for i in input().split(" ")]
    priceList[i] = tmp[0]
    KnowList[i] = tmp[1:]
price = 0
ansList = []
knowledge = [0] * M
dfs(price, knowledge, 0)
if (len(ansList) == 0):
    ansList.append(-1)
print(min(ansList))
t = [0]
x = [0]
y = [0]
n = int(input())
for i in range(n):
  ti, xi, yi = map(int,input().split())
  t.append(ti)
  x.append(xi)
  y.append(yi)
  
flg = True 
for i in range(1,N+1):
  if (t[i]-t[i-1]) < (x[i]-x[i-1]+y[i]-y[i-1]):
    flg = False
  elif ((t[i]-t[i-1])%2) != ((x[i]-x[i-1]+y[i]-y[i-1])%2):
    flg = False
if(flg):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

t = [0]
x = [0]
y = [0]
n = int(input())
for i in range(n):
    ti, xi, yi = map(int, input().split())
    t.append(ti)
    x.append(xi)
    y.append(yi)
    
flg=True
for i in range(1, n+1):
    if((x[i]-x[i-1])+(y[i]-y[i-1])>(t[i]-t[i-1])):
        flg=False
    elif(((x[i]-x[i-1])+(y[i]-y[i-1]))%2!=(t[i]-t[i-1])%2):
        flg=False
if(flg):
    print("Yes")
else:
    print("No")
a=int(input())
print(2* \pi *a)


### FIXED CODE ###

import math
a=int(input())
print(2* math.pi *a)
_list = [int(i) for i in input().split(' ')]
if sum(_list) % 2 != 0:
  print("IMPOSSIBLE")
  return
print(sum(_list)/2)

### FIXED CODE ###

_l = input().split()
_s = sum([int(i) for i in _l])
if _s % 2 != 0:
    print('IMPOSSIBLE')
else:
    print(int(_s / 2))
D, N = map(int, input().split())

if N < 99:
  print(100**D*N)
elif N = 100:
  print(100**D*101)


### FIXED CODE ###

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

if N < 100:
  print(100**D*N)
elif N == 100:
  print(100**D*101)
s = int(input())
t = int(input())
print(t+s)

### FIXED CODE ###

s  = input().split()
print(s[1]+s[0])
n = int(input())
e = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = [int(i) - 1 for i in input().split()]
    e[a].append(b)
    e[b].append(a)

mod = 10**9+7

kkai = [1]
for i in range(1, 10 ** 6):
    kkai.append(kkai[-1] * i % mod)


def kai(x, p=mod):
    return kkai[x]


def comb(a, b, p=mod):
    if a < 0 or b < 0:
        return 0
    elif a < b:
        return 0
    if b == 0:
        return 1
    c = 1
    c *= kai(a, p)
    c *= pow(kai(b, p), p - 2, p)
    c *= pow(kai(a - b, p), p - 2, p)
    return c % p


child = [0] * n


def dfs1(i=0, r=-1):
    s = 1
    for j in e[i]:
        if j == r:
            continue
        s += dfs1(j, i)
    child[i] = s
    return s


dfs1()

a = [0] * n


def dfs2(i=0, r=-1):
    s = 1
    t = 0
    for j in e[i]:
        if j == r:
            continue
        t += child[j]
        s *= dfs2(j, i)
        s %= mod
        s *= comb(t, child[j])
        s %= mod
    a[i] = s
    return s


dfs2()

b = [0] * n


def dfs3(i=0, r=-1):
    if r == -1:
        b[i] = a[i]
    else:
        s = b[r] * comb(n-1, child[i]-1) % mod
        re = comb(n-1, child[i])
        s *= pow(re, mod - 2, mod)
        s %= mod
        b[i] = s

    for j in e[i]:
        if j == r:
            continue
        dfs3(j, i)


dfs3()

print("\n".join(map(str, b)))


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)


def input():
    return sys.stdin.readline()


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

mod = 10**9+7

kkai = [1]
for i in range(1, 2*10 ** 5):
    kkai.append(kkai[-1] * i % mod)


def kai(x, p=mod):
    return kkai[x]


def comb(a, b, p=mod):
    if a < 0 or b < 0:
        return 0
    elif a < b:
        return 0
    if b == 0:
        return 1
    c = 1
    c *= kai(a, p)
    c *= pow(kai(b, p), p - 2, p)
    c *= pow(kai(a - b, p), p - 2, p)
    return c % p


child = [0] * n


def dfs1(i=0, r=-1):
    s = 1
    for j in e[i]:
        if j == r:
            continue
        s += dfs1(j, i)
    child[i] = s
    return s


dfs1()
a = [0] * n


def dfs2(i=0, r=-1):
    s = kai(child[i]-1)
    t = 1
    for j in e[i]:
        if j == r:
            continue
        s *= dfs2(j, i)
        s %= mod
        t *= kai(child[j])
        t %= mod
    s *= pow(t, mod - 2, mod)
    s %= mod
    a[i] = s
    return s


dfs2()
b = [0] * n


def dfs3(i=0, r=-1):
    if r == -1:
        b[i] = a[i]
    else:
        s = b[r] * child[i] % mod
        s *= pow(n-child[i], mod - 2, mod)
        s %= mod
        b[i] = s

    for j in e[i]:
        if j == r:
            continue
        dfs3(j, i)


dfs3()
print("\n".join(map(str, b)))