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

nodes = []

for i in range(N):
    nodes.append([])

for i in range(N-1):
    a, b = [int(v) for v in input().split(' ')]
    a -= 1
    b -= 1
    nodes[a].append((b, i))
    nodes[b].append((a, i))


max_l = 0
max_i = 0
for i, links in enumerate(nodes):
    l = len(links)
    if max_l < l:
        max_l = l
        max_i = i

def fill(nodes, links, e, pc):
    c = 1
    if c == pc:
        c += 1

    next_fills = []
    for n, i in links:
        if e[i] != 0:
            continue
        e[i] = c
        next_fills.append((n, c))

        c += 1
        if c == pc:
            c += 1

    for n, c in next_fills:
        fill(nodes, nodes[n], e, c)
    
e = [0] * (N - 1)
fill(nodes, nodes[max_i], e, 0)

print(max_l)
for i in e:
    print(i)

### FIXED CODE ###

N = int(input())

nodes = []
edge = []
for i in range(N):
    nodes.append([])

for i in range(N-1):
    a, b = [int(v) - 1 for v in input().split(' ')]
    if a >= len(nodes):
        exit()
    if b >= len(nodes):
        exit()
    nodes[a].append((b, i))
    nodes[b].append((a, i))
    edge.append(0)

max_l = 0
max_i = 0
if nodes is None:
    exit()

for i, links in enumerate(nodes):
    if links is None:
        exit()
    l = len(links)
    if max_l < l:
        max_l = l
        max_i = i

def fill(nodes, edge, queue):
    while len(queue) > 0:
        ni, pc = queue.pop(0)
        links = nodes[ni]

        c = 1
        if pc == c:
            c += 1

        if links is None:
            exit()

        next_links = []
        for n, i in links:
            if n < 0 or i < 0:
                exit()
            if n >= len(nodes) or i >= len(edge):
                exit()

            if edge[i] != 0:
                continue
            edge[i] = c
            queue.append((n, c))

            c += 1
            if pc == c:
                c += 1

queue = [(max_i, 0)]    
fill(nodes, edge, queue)

print(max_l)
for e in edge:
    print(e)
R = range(100)
M = [[2,5,2,2,2][i%5] for i in R]
Out = [-1] *100
P = [-1]*100
S = [-1]*17
Q = []
W = [0]*100

def stand(I, s):
  n = M[I]
  P[I] = -1
  S[s:s+n] = [-1] * n
  Out[I] = -1
  return 1

def sit(I, s):
  n = M[I]
  P[I] = s
  S[s:s+n] = [I] * n
  Out.[I] = t+ 17*(I%2)+3*(I%3)+19
  W[I] = t - I*5
  return

def check(I):
  n = M[I]
  for s in range(17-n):
    if S[s:s+n] == [-1]*n: return s
  return -1

t = 0
c = 0
while t<100:
  while t in Out:
    I = Out.index(t)
    c += stand(I, P[I])

  if t<500 and t%5==0: Q.append(t/5)
 
  while len(Q)>0:
    s = check(Q[0])
    if s==-1: break
    sit(Q.pop(0), s)
  t += 1

while 1:
  try: print W[int(raw_input())]
  except: break

### FIXED CODE ###

S = [0]*17
Q = []
W = [0]*100
 
def check(I):
  n = [2,5][I%5==1]
  for s in range(17-n+1):
    if S[s:s+n] == [0]*n: return s
  return -1

t = 0
c = 0
while c<100:
  for i in range(S.count(t)): S[S.index(t)]=0
  if t<500 and t%5==0: Q.append(t/5)
  
  while len(Q)>0:
    s = check(Q[0])
    if s==-1: break
    I = Q.pop(0)
    n = [2,5][I%5==1]
    S[s:s+n] = [t+ 17*(I%2) + 3*(I%3) + 19] * n
    W[I] = t - I*5
    c += 1
  t += 1
 
while 1:
  try: print W[int(raw_input())]
  except: break
n, k = map(int, input().split())
p_n = [int(i) for i in input().split()]

def expected(x):
    return (x+1)/2

def test3():
    e_n = list(map(expected, p_n))
    s_n = []
    for i, e in enumerate(e_n):
        if i == 0:
            s_n.append(e)
            continue
        s_n.append(s_n[i-1] + e)
    result = []
    for i in range(len(s_n)):
        if i+k >= n:
            continue
        result.append(s_n[i+k]-s_n[i])
    print(max(result))      

test3()

### FIXED CODE ###

n, k = map(int, input().split())
p_n = [int(i) for i in input().split()]

def expected(x):
    return (x+1)/2

def test3():
    e_n = list(map(expected, p_n))
    s_n = []
    for i, e in enumerate(e_n):
        if i == 0:
            s_n.append(e)
            continue
        s_n.append(s_n[i-1] + e)
    result = []
    result.append(s_n[k-1])
    for i in range(len(s_n)):
        if i+k >= n:
            continue
        result.append(s_n[i+k]-s_n[i])
    print(max(result))      
test3()
n = int(raw_input())
num = map(int, raw_input().split())
num.sort(revers = True)
print num


### FIXED CODE ###

n = int(input())
num = reversed(input().split())
print(" ".join(num))
max_Vi = 10**3
max_Wi = W
import sys
input = sys.stdin.readline
import numpy as np
N,W=map(int,input().split())
dp=[0]+[max_Wi+1]*(N*max_Vi)
dp=np.array(dp)
for i in range(N):
  wi,vi=map(int,input().split())
  dp[vi:]=np.minimum(dp[vi:],dp[:-vi]+wi)
print(np.max(np.where(dp <= W)))

### FIXED CODE ###

import sys
input = sys.stdin.readline
import numpy as np
N,W=map(int,input().split())
dp=np.ones(10**5+1, dtype='int64')
dp[0]=0
dp[1:]=dp[1:]*(10**9+1)
for i in range(N):
  wi,vi=map(int,input().split())
  dp[vi:]=np.minimum(dp[vi:],dp[:-vi]+wi)
print(np.max(np.where(dp <= W)))
str_list = input().split(' ')
int_list = [int(x) for x in str_list]
N, K, Q = int_list[0], int_list[1], int_list[2]
A = []
for _ in range(Q):
    A.append( int(input()) )
point = [int(K)]*N
import numpy as np
point = np.array(point)
for ii in range(Q):
    point[A[ii]-1] += 1
point -= Q
for ii in range(N):
    if point[ii] <= 0:
        print('No')
    else:
        print('Yes')


### FIXED CODE ###

w = input()

if w=='Sunny':
    print('Cloudy')
elif w=='Rainy':
    print('Sunny')
elif w=='Cloudy':
    print('Rainy')
from collections import *
import sys
from bisect import *
input=sys.stdin.readline
from math import *
t=1
while(t):
    t-=1
    n,m,k=map(int,input().split())
    a=list(map(int,input().split()))
    b=list(map(int,input().split()))
    prea=[a[0]]
    preb=[b[0]]
    for i in range(1,n):
        prea.append(prea[-1]+a[i])
    for j in range(1,m):
        preb.append(preb[-1]+b[i])
    r=0
    for i in range(n):
        if(k-prea[i]<0):
            break
        re=k-prea[i]
        rr=bisect_right(preb,re)
        r=max(r,i+1+rr)
    for i in range(m):
        if(k-preb[i]<0):
            break
        re=k-preb[i]
        rr=bisect_right(prea,re)
        r=max(r,i+1+rr)
    print(r)


### FIXED CODE ###

from collections import *
import sys
from bisect import *
input=sys.stdin.readline
from math import *
t=1
while(t):
    t-=1
    n,m,k=map(int,input().split())
    a=list(map(int,input().split()))
    b=list(map(int,input().split()))
    prea=[a[0]]
    preb=[b[0]]
    for i in range(1,n):
        prea.append(prea[-1]+a[i])
    for j in range(1,m):
        preb.append(preb[-1]+b[j])
    r=0
    for i in range(n):
        if(k-prea[i]<0):
            break
        re=k-prea[i]
        rr=bisect_right(preb,re)
        r=max(r,i+1+rr)
    for i in range(m):
        if(k-preb[i]<0):
            break
        re=k-preb[i]
        rr=bisect_right(prea,re)
        r=max(r,i+1+rr)
    print(r)
a = int(input())
b =int(input())
print(a+b,a*b)




### FIXED CODE ###

a,b = map(int,input().split())
print(a*b,2*(a+b))
n=int(input())
for i in range((2*n)**0.5-3,n**0.5+2):
  if i*(i+1)//2=n:
    for j in range(1,i+1):
      print(j)
    break
  elif i*(i+1)//2>n:
    k=i*(i+1)//2-n
    for j in range(1,i+1):
      ifr j!=k:
        print(j)
    break

### FIXED CODE ###

n=int(input())
for i in range(int((2*n)**0.5-3),n+2):
  if i*(i+1)//2==n:
    for j in range(1,i+1):
      print(j)
    break
  elif i*(i+1)//2>n:
    k=i*(i+1)//2-n
    for j in range(1,i+1):
      if j!=k:
        print(j)
    break
N = int(input())
S = input()

mmax = 0
for i in range(2, N-1):
  a = set(N[:i])
  b = set(N[i:])
  mmax = max(len(a&b), mmax)
print(mmax)

### FIXED CODE ###

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

mmax = 0
for i in range(2, N-1):
  a = set(S[:i])
  b = set(S[i:])
  mmax = max(len(a&b), mmax)
print(mmax)
N = int(input())
S = [int(i) for i in input().split()].sort()

flg = 0
for i in range(1,N):
  if S[i] = S[i-1]:
    flg = 1
    
if flg == 1:
  print("NO")
else:
  print("YES")  


### FIXED CODE ###

import numpy as np

N = int(input())
S = np.array([int(i) for i in input().split()])

if len(np.unique(S))==len(S):
  print("YES")
else:
  print("NO")
while 1:
????????r, c = map(int, raw_input().split())
????????if r == 0: break
????????old = [raw_input().split() for i in range(r)]
????????old = map(list, zip(*old))
????????new = [int("".join(lst),2) for lst in old]
????????ans = 0
????????for i in range(1<<(r-1)):
????????????????ret = 0
????????????????for j in new:
????????????????????????cnt = bin(i^j).count('1')
????????????????????????ret += cnt if cnt > r/2 else r-cnt
????????????????ans = max(ans, ret)
????????print ans

### FIXED CODE ###

while 1:
    r, c = map(int, raw_input().split())
    if r == 0: break
    old = [raw_input().split() for i in range(r)]
    old = map(list, zip(*old))
    new = [int("".join(lst),2) for lst in old]
    ans = 0
    for i in range(1<<(r-1)):
        ret = 0
        for j in new:
            cnt = bin(i^j).count('1')
            ret += cnt if cnt > r/2 else r-cnt
        ans = max(ans, ret)
    print ans
n,k,s=map(int,input().split())
a=[]

if s != 10**9 or k==n

    for i in range(k):
        a.append(s)

    for j in range(k,n):
        a.append(s+1)

    b=map(str,a)

    print(" ".join(b))

else:
    for i in range(k):
        a.append(s)
    a.append(1)
    for j in range(k+1,n):
        a.append(0)

    b=map(str,a)

    print(" ".join(b))

### FIXED CODE ###

n,k,s=map(int,input().split())
a=[]

if (s != 10**9):

    for i in range(k):
        a.append(s)
    for j in range(k,n):
        a.append(s+1)

else:

    for i in range(k):
        a.append(s)
    for j in range(k,n):
        a.append(1)

b=map(str,a)

print(" ".join(b))
from math import gcd
N = int(input())
T = int(input())
for i in range(N-1):
    t = int(input())
    T = int(T / gcd(T, t) * t)
print(int(T))

### FIXED CODE ###

import math
N = int(input())
T = int(input())
for i in range(N-1):
    t = int(input())
    T = T // math.gcd(T, t) * t
print(T)
S=str(input())
N=len(S)
if S!=S[::-1]:#Sと反転したSが不一致
    print('No')
else:
    S1=S[:(N-1)/2]#Sが1文字目～(N-1)/2番目の場合
    S2=S[(N+3)/2:]#Sが(N+3)/2～N番目の場合
    if S1==S1[::-1] and S2==S2[::-1]:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

S=str(input())
N=len(S)
if S!=S[::-1]:#Sと反転したSが不一致
    print('No')
else:
    S1=S[0:(N-1)//2]#Sが1文字目～(N-1)/2番目の場合
    S2=S[(N+1)//2:N]#Sが(N+3)/2～N番目の場合
    if S1==S1[::-1] and S2==S2[::-1]:
        print('Yes')
    else:
        print('No')
import sys
n = int(input())
a = list(map(int,input().split()))
'''
for num in a:
  i = a.index(num)
  if(num in a[i+1:]):
    print("NO")
    sys.exit()
print("YES")
'''

i=0
while(i<n):
  if(a[i] in a[i+1:]):
    print("NO")
    sys.exit()
  i += 1
print("YES")

### FIXED CODE ###

s, t = map(str,input().split())	
a, b = map(int,input().split())	
u = input()
if(s == u):
  a -= 1;
elif(t == u):
  b -= 1;
print("{} {}".format(a, b))
import numpy as np
A = np.asarray(input().split()).astype(np.int)
 
ans = 0
mod = 10**9 + 7
for i in range(N):
    pA = (A[i] % mod) * (A[i+1:].sum() % mod)
    ans += pA
 
print(int(ans % mod))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
D = 1000000007


ans = 0
B = [0] * (N + 1)

for i in range(N-1, -1, -1):
    B[i] = (B[i+1] + A[i]) % D

for i in range(0, N-1):
    ans += (A[i] * B[i+1]) % D

print(int(ans % D))
n,k=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
x=[l[i][0] for i in range(n)]
x.sort()
y=[l[i][1] for i in range(n)]
y.sort()
ans=[]
for i1 in range(n):
  for i2 in range(n):
    for i3 in range(n):
      for i4 in range(n):
        ct=0
        for i5 in range(n):
          if min(x[i1],x[i2])<=l[i5][0]<=max(x[i1],x[i2]) and min(y[i3],y[i4])<=l[i5][1]<=max(y[i3],y[i4]):ct+=1
        if ct>=k:
          ans.append(abs(x[i1]-x[i2])*abs(y[i3]-y[i4]))
print(min(ans))

### FIXED CODE ###

a,b,c=map(int,input().split())
if a==b:print(c)
elif a==c:print(b)
else:print(a)
#! /usr/bin/env python3
import math

N = int(input())
T = sorted(set([int(input()) for x in range(N)]))
a = 1
for i in T[:-1] : a *= i
print((a * T[-1]) // math.gcd(a, T[-1]))


### FIXED CODE ###

#! /usr/bin/env python3


def gcd(a, b):
    if a < b : return gcd(b, a)
    while b != 0:
        t = a % b
        a = b
        b = t
    return a

N = int(input())
T = sorted(set([int(input()) for x in range(N)]))
a = T[-1]
for i in T[:-1]:
    a = (a * i) // gcd(a, i)

print(a)
mod = 10**9 + 7
def iip(listed = False):
    ret = [int(i) for i in input().split()]
    if len(ret) == 1 and not listed:
        return ret[0]
    return ret

def inv(n, mod):
    return power(n, mod-2)

def power(n, p):
    if p == 0:
        return 1
    if p % 2 == 0:
        return (power(n, p//2) ** 2) % mod
    if p % 2 == 1:
        return (n * power(n, p-1)) % mod

def soinsuu_bunkai(n):
    ret = []
    for i in range(2, int(n**0.5)+1):
        while n % i == 0:
            n //= i
            ret.append(i)
        if i > n:
            break
    if n != 1:
        ret.append(n)
    return ret

n = iip()
A = iip()

def main():
    ss = []
    for a_i in A:
        for s in ss:
            if a_i % s == 0:
                a_i //= s

        ss.extend(soinsuu_bunkai(a_i))

    #print(ss)
    all = 1
    for s in ss:
        all *= s
        all %= mod

    ans = 0
    for a_i in A:
        ans += (all * inv(a_i, mod)) % mod
        ans %= mod
    print(ans)


main()

### FIXED CODE ###

import math
import time


t = time.time()
def iip():
    ret = [int(i) for i in input().split()]
    if len(ret) == 1:
        return ret[0]
    return ret

def fkc(keta):
    return 10**keta

def pat_b(a, n):
    tail = a % 10

    if tail == 0:
        return 0

    head = int(str(a)[0])

    ret = 0
    if tail == head: #１桁解
        ret += 1

    if n >= tail*10+head: #２桁解は１通りあるかないか
        ret += 1

    for free_keta in range(1, 6): # 3桁以上解
        mincase = 10**(free_keta+1) * tail + head

        if n < mincase:
            break
        if n >= 10**(free_keta+1) + mincase + head - 10:
            ret += fkc(free_keta)
            continue
        else:
            ret += int(int(n-mincase)/10) + 1
    return ret

def main():
    n = iip()
    result = 0
    for i in range(n+1):
        result += pat_b(i, n)
    print(result)


main()
l = input().split(" ").sort()
print(int(l[0] + l[1]) + int(l[2])

### FIXED CODE ###

str = input().split(" ")
str.sort(reverse=True)
print(int(str[0] + str[1]) + int(str[2]))
L,R,D=map(int,input.split())
A=0
for i in range(L,R+1):
  if i%D==0:
    A+=1
print(A)

### FIXED CODE ###

L,R,D=map(int,input().split())
A=0
for i in range(L,R+1):
  if i%D==0:
    A+=1
print(A)
S = input()
Steam = 0
minecraft = 0
for i in range()len(S):
    if S[i] == "+":
        minecraft += 1
    else:
        Steam += 1
L = minecraft * 1
P = Steam * -1
print(L + P)

### FIXED CODE ###

S = input()
Steam = 0
minecraft = 0
for i in range(len(S)):
    if S[i] == "+":
        minecraft += 1
    else:
        Steam += 1
L = minecraft * 1
P = Steam * -1
print(L + P)
#import math

while True:
    w = []
    k = []
    for i in range(10):
        w.append(int(input()))
    for i in range(10):
        k.append(int(input()))
    w.sort()
    w.reverse()
    k.sort()
    k.reverse()
    print(w[0]+w[1]+w[2],k[0]+k[1]+k[2])


### FIXED CODE ###

w = [int(input()) for i in range(10)]
k = [int(input()) for i in range(10)]
w.sort()
k.sort()
print(sum(w[-3:]),sum(k[-3:]))
# -*- coding: utf-8 -*-
s = input()
s = list(s)
x = 0
maxIndex = len(s) - 1
count = 0
while True:
    if len(s) <= x:
        break
    if s[x] != s[x + 1]:
        s.pop(x)
        s.pop(x)
        maxIndex = len(s) - 1
        count += 1
    else:
        x += 1
print(count * 2)


### FIXED CODE ###

s = input()
x = 0
for c in s:
    if c == '1':
        x = x + 1
print(min(x, len(s) - x) * 2)
N = int(input())
a = list(map(int, input().split()))

if len(a) == 2:
    x = a[0]
    y = a[-1]
    print(abs(x-y))
    exit()


total = sum(a)
mid = total//2

print(mid)
for i in range(1, N):
    x += a[i]
    if x <= mid:
        continue
    else:
        print(x-(total - x))
        print(min(abs(x-a[i]-(total - (x-a[i]))), abs(x-(total - x))))
        exit()

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
x = a[0]
total = sum(a)
y = total - x
ans = abs(x - y)
for i in range(1, N-1):
    x += a[i]
    y -= a[i]
    m = abs(x-y)
    if ans > m:
        ans = m
print(ans)
A,B=map(int,input().split())
print(max(0,A-2*B)

### FIXED CODE ###

A,B=input().split()
ans=int(A)-int(B)*2
if ans > 0:
  print(ans)
else:
  print(0)
a, b = input()
if a == b :
  print("H")
else:
  print("D")

### FIXED CODE ###

a, b = input().split()
if a == b :
  print("H")
else:
  print("D")
A = int(input())
B = int(input())

X = int(input())

value = X - A

if value < 0:
    print('NO')
elif value < B:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

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

value = X - A

if value < 0:
    print('NO')
elif value < B:
    print('YES')
else:
    print('NO')
N = int(input())
L = list(map(int,input().strip().split()))
L_sort = L.sort()
count = 0
for i in range(N-2):
	for j in range(i+1 , N):
		for k in range(j+1 , N):
        		if L_sort[i] + L_sort[j] > L_sort[k]:
            			count += 1
                else:
                	k += 1
print(count)

### FIXED CODE ###

N = int(input())
L = list(map(int, input().split()))

L.sort()
count = 0

for i in range(N):
    for j in range(i + 1, N):
        for k in range(j + 1, N):             
            if L[i] == L[j] or L[j] == L[k] or L[k] == L[i]:
                continue
            if L[i] + L[j] > L[k]:
                count += 1

print(count)
while True:
	try: a,b = map(int,input().split()) ; print len(a+b)
 	excpet EOFError: break

### FIXED CODE ###

import sys
for i in sys.stdin:print len(str(sum(map(int,i.split()))))
N, K = map(int,input().split()) # 複数の数字を変数に格納

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
  
red = N - K
blue = K
division = 10 ** 9 + 7

for i in range(K):
    if i > red:
        print("0")
    else:
        tmp_blue = cmb(blue-1,i)
        tmp_red = 1
        for j in range(i+1):
            tmp_red = tmp_red * (red+1-j) / (j+1) % division 
        result = int(tmp_blue * tmp_red % division)
        print("{}".format(result))


### FIXED CODE ###

N, K = map(int,input().split()) # 複数の数字を変数に格納

red = N - K
blue = K
division = 10 ** 9 + 7

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under % division
  
for i in range(K):
    if i > red:
        print("0")
    else:
        tmp_blue = cmb(blue-1,i) % division
        tmp_red = cmb(red+1,red-i)
        result = int(tmp_blue * tmp_red % division)
        print("{}".format(result))
#coding: UTF-8

import math


if __name__ == "__main__":
	a = int(input())
	b = int(input())
	x = int(input())
	if a%x == 0:
		print((b-a)//x+1)
	else:
		print((b-a)//x)

### FIXED CODE ###

#coding: UTF-8

import math


if __name__ == "__main__":
	data = list(map(int,input().split()))
	a = data[0]
	b = data[1]
	x = data[2]
	if a%x == 0:
		print((b-a)//x+1)
	else:
		if x > b:
			print("0")
		else: 
			if x < a:
				print((data[1]-(a+(x-a%x)))//data[2]+1)
			else:
				print((data[1]-data[2])//data[2]+1)
A, B = map(int, input().split())
if A == 1:
    A += 13
if B == 1:
    B += 13
win_Alice = A - B
if win_Alice = 0:
    print('Draw')
else:
    print('Alice' if win_Alice > 0 else 'Bob')

### FIXED CODE ###

A, B = map(int, input().split())
if A == 1:
    A += 13
if B == 1:
    B += 13
win_Alice = A - B
if win_Alice == 0:
    print('Draw')
else:
    print('Alice' if win_Alice > 0 else 'Bob')
N,M,Q=map(int,input().split())
ABCD=[list(map(int,input().split())) for i in range(Q)]
from itertools import combinations
ans=0
for p in combinations(range(N+M),M):
    r=0
    for a,b,c,d in ABCD:
        if p[b-1]-b+1-p[a-1]+a-1==c:
            r+=d
    ans=max(ans,r)
print(ans)

### FIXED CODE ###

N,M,Q=map(int,input().split())
ABCD=[list(map(int,input().split())) for i in range(Q)]
from itertools import combinations
ans=0
for p in combinations(range(N+M-1),N):
    r=0
    for a,b,c,d in ABCD:
        if p[b-1]-b+1-(p[a-1]-(a-1))==c:
            r+=d
    ans=max(ans,r)
print(ans)
a,b=map(int,input().split())↲
c=a*3
d=c+d/2
print(d)↲

### FIXED CODE ###

a, p = map(int, input().split())
#print (int((a*3 + p) / 2))
#a,p=map(int,input().split())↲
print(int((a*3+p)/2))
n=int(input())

if 9 in n:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n=input()
if '9' in n:
  print('Yes')
else:
  print('No')
n = int(input())
ar = list(map(int, input().split()))

try:
	assert 3 <= n <= 10
	assert len(ar) == n
	assert (1 <= min(ar)) and (max(ar) <= 100)
    
	if max(ar) < sum(ar) - max(ar):
		print("Yes")
	else:
		print("No")
except:
  print("No")


### FIXED CODE ###

T, X = map(int, input().split())

print(float(T)/X)
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
Count=0
for i in range(n):
    a=list(map(int,input().split()))
    for j in range(m):
        Sum+=a[j]*b[j]
    if Sum>-1*c:
        Count+=1
    Sum=0
print(Count)

### FIXED CODE ###

n,m,c=map(int,input().split())
b=list(map(int,input().split()))
a=[list(map(int,input().split())) for _ in range(n)]
Count=0
for t in a:
    Sum=0
    for i in range(m):
        Sum+=t[i]*b[i]
    if Sum+c>0:
        Count+=1
print(Count)
n = int(input())
A = list(map(int, input().split()))
q = int(input())
mi = map(int, input().split())
S = {}

def solve(i, m):
    if (m == 0):
        return True
    if (i >= n):
        return False
    
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    return res

for j in range(1, q + 1):
    if solve(0, mi):
        print("yes")
    else:
        print("no")

### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
q = int(input())
mi = map(int, input().split())
t = {}

def solve(i, m):
    if (m == 0):
        return True
    if (i >= n):
        return False
    if (i,m) in t:
        return t[(i,m)]
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    t[(i,m)] = res
    return res

for m in mi:
    if solve(0, m):
        print("yes")
    else:
        print("no")
S = input().split("/")

if S[0]>= 2020:
  print("TBD")
elif S[0] == 2019:
  if S[1] >5:
    print("TBD")
  else:
    print("Heisei")
else:
  print("Heisei")

### FIXED CODE ###

S = input().split("/")


if int(S[0])>= 2020:
  print("TBD")
elif int(S[0]) == 2019:
  if int(S[1]) >=5:
    print("TBD")
  else:
    print("Heisei")
else:
  print("Heisei")
x, y, z = [int(i) for i in s.split()]
l = [int(i) for i in s.split()]

if x = 1:
  print(abs(z - l[x-1]))
else:
  if abs(z - l[x-1]) > abs(l[x-1] - l[x-2]):
    print(abs(z - l[x-1]))
  else:
    print(abs(l[x-1] - l[x-2]))

### FIXED CODE ###

s1 = input()
s2 = input()

x, y, z = [int(i) for i in s1.split()]
l = [int(i) for i in s2.split()]

if x == 1:
  print(abs(z - l[x-1]))
else:
  if abs(z - l[x-1]) > abs(l[x-1] - l[x-2]):
    print(abs(z - l[x-1]))
  else:
    print(abs(l[x-1] - l[x-2]))