Harryxun/stf_run huggingface dataset:
import sys
N = int(input().strip())

n_list = [[] for i in range(N)]
d = [0] * N

for i in range(N-1):
    a, b = map(int, input().strip().split())
    a -= 1
    b -= 1
    n_list[a].append([b,i])
    n_list[b].append([a,i])
    d[a] += 1
    d[b] += 1


#print(n_list)
#print(d)

d_dict = {}
for i in range(N):
    d_dict[i] = d[i]
tmp = sorted(d_dict.items(), key = lambda x:x[1], reverse = True)

colors = [0] * (N)

root = tmp[0][0]

def paint(node, parent_edge_id):
    #print(node, parent_edge_id)
    tmp_color = 1
    for edge in n_list[node]:
        #print("ege:", edge)
        if edge[1] != parent_edge_id:
            if parent_edge_id != -1 and tmp_color == colors[parent_edge_id]:
                tmp_color += 1
            colors[edge[1]] = tmp_color
            paint(edge[0], edge[1])
            tmp_color += 1

    
#sys.setrecursionlimit(10**7)
try:
    paint(tmp[0][0], -1)
except RecursionError as e:
    print(e)
    print(0)
    exit(0)
print(tmp[0][1]) # color num 
for i in range(N-1):
    print(colors[i])

### FIXED CODE ###

import sys
N = int(input().strip())

n_list = [[] for i in range(N)]
d = [0] * N

for i in range(N-1):
    a, b = map(int, input().strip().split())
    a -= 1
    b -= 1
    n_list[a].append([b,i])
    n_list[b].append([a,i])
    d[a] += 1
    d[b] += 1


#print(n_list)
#print(d)

d_dict = {}
for i in range(N):
    d_dict[i] = d[i]
tmp = sorted(d_dict.items(), key = lambda x:x[1], reverse = True)

colors = [0] * (N)

root = tmp[0][0]

def paint(node, parent_edge_id):
    #print(node, parent_edge_id)
    tmp_color = 1
    for edge in n_list[node]:
        #print("ege:", edge)
        if edge[1] != parent_edge_id:
            if parent_edge_id != -1 and tmp_color == colors[parent_edge_id]:
                tmp_color += 1
            colors[edge[1]] = tmp_color
            paint(edge[0], edge[1])
            tmp_color += 1

    
sys.setrecursionlimit(10**7)
paint(tmp[0][0], -1)
print(tmp[0][1]) # color num 
for i in range(N-1):
    print(colors[i])
import sys
input = sys.stdin.readline
W, H, x, y = map(int, input().split())
S = W * H * 0.5
if (y/x == H/W):
  print(S, 1)
else:
  print(S, 0)

### FIXED CODE ###

import sys
input = sys.stdin.readline
W, H, x, y = map(int, input().split())
S = W * H * 0.5
if (x != 0 and y/x == H/W and W % 2 == 0):
  print(S, 1)
else:
  print(S, 0)
R, G, B, N = map(int, input().split())
ans = 0
r=0
while r*R <= N:
    g=0
    while r*R + g*G <= N:
        if (N - r*R - g*G) % B == 0:
            ans += 1
        g += 1
    r += 1
print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
print(N-K+1)
n = int(input())
h = list(map(int, input().split()))

cnt = [0]*(n-1)
for i in range(0, len(h)-1):
    for j in range(i, len(h)-1):
        if h[j] >= h[j+1]:
            cnt[i] += 1
        else:
            break

print(max(cnt))


### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))

out, cnt = 0, 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        cnt += 1
        out = max(out, cnt)
    else:
        cnt = 0

print(out)
A, B = map(int, input().split())

import math

print(A * B // math.gcd(A, B))

### FIXED CODE ###

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

import fractions 

print(A * B // fractions.gcd(A, B))
number=list(map(int,input().split()))
likes=[]
result=0
for i in number[0]:
    for j in number[1]:
        rawdata=list(map(int,input().split()))
        for k in rawdata[0]:
            likes.append(rawdata[k+1])
for i in number[1]:
    if likes.count(i+1):
        result+=1
print(result)

### FIXED CODE ###

number=list(map(int,input().split()))
likes=[]
result=0
for i in range(number[0]):
    rawdata=list(map(int,input().split()))
    for k in range(rawdata[0]):
        likes.append(rawdata[k+1])
for i in range(number[1]):
    if likes.count(i+1)==number[0]:
        result+=1
print(result)
N = int(input())
H = [int(x) for x in input().split()]
count = 0
for i in range(N):
  for j in range(i):
    if H[i] < H[j]:
      break
  else:
      count+=1
print(count)


### FIXED CODE ###

str = input()
S = list(str)
N = len(S)
count = 0
for x in range(N):
    if x % 2 == 0 and S[x] == "0":
        count += 1
    elif x % 2 == 1 and S[x] == "1":
        count += 1
if count > N / 2:
    print(N - count)
else:
    print(count)
import warnings
warnings.simplefilter('ignore')

from numba import jit

N = int(input())
As = list(map(int, input().split(' ')))


@jit
def test(As):
    not_divisible = 0
    for num_i, Ai in enumerate(As):
        for num_j, Aj in enumerate(As):
            if num_i==num_j:
                continue
            if Ai%Aj==0:
                break
        else:
            not_divisible += 1
    print(not_divisible)
    
test(As)

### FIXED CODE ###

import itertools
import numpy as np

X, N = list(map(int, input().split(' ')))
ps = input()
if len(ps)!=0:
    ps = list(map(int, ps.split(' ')))

ps_sort = list(sorted(ps))
not_in_ps = np.array([[abs(i-X), i] for i in range(-1, 102) if i not in ps_sort])
print(not_in_ps[np.argmin(not_in_ps[:,0], 0), 1])
import queue
import numpy
def main():
    h,w=map(int,input().split())
    maze=[]
    r_append=maze.append
    for i in range(h):
        #r_append=maze.append
        row=input()
        r_append(row)
    #print(maze)
    root=numpy.array([[-1 for i in range(h*w)] for i in range(h*w)])
    ina=numpy.array([i for i in range(h*w)])
    for i in range(h):
        for j in range(w):
        # print(maze[i][j])
            now=w*i+j
            hidari=w*i+j-1
            migi=w*i+j+1
            ue=w*(i-1)+j
            sita=w*(i+1)+j
            if maze[i][j]==".":
                if j>0:
                    if maze[i][j-1]!="#":
                        root[now][hidari]=0
                if i+1<h:
                    if maze[i+1][j]!="#":
                        root[now][sita]=0
                if j+1<w:
                    if maze[i][j+1]!="#":
                        root[now][migi]=0
                if 0<i:
                    if maze[i-1][j]!="#":
                        root[now][ue]=0
            else:
                ina[now]=-1
                if j>0:
                    root[now][hidari]=-1
                if i+1<h:
                    root[now][sita]=-1
                if j+1<w:
                    root[now][migi]=-1
                if 0<i:
                    root[now][ue]=-1
    #print(root)
    max=0
    hw=h*w
    for start in range(hw):
        if ina[start]==-1:
           # print(start,"is unreachable")
            continue
        dist=[0]*(hw)
        now=start
        dist[start]=0
        visted=[0]*(hw)
        toVis=queue.Queue()
        visted[now]=1
        for i in range(hw):
            if root[now][i]!=-1:
                toVis.put(i)
                dist[i]=dist[now]+1
        while toVis.empty()!=True:
            now=toVis.get()
            visted[now]=1
            le=dist[now]
            for i in range(hw):
                if root[now][i]!=-1 and visted[i]!=1:
                    toVis.put(i)
                    dist[i]=le+1
        farest=dist[now]
        if max<farest:
            max=farest
    print(max)
            
if __name__=="__main__":
    main()


    
            

### FIXED CODE ###

h,w=map(int,input().split())
n=h*w
inf=10**6
field=[]
for i in range(h):
    field.append(input())
dist=[[inf]*n for i in range(n)]
for i in range(h):
    for j in range(w):
        if field[i][j]=="#":continue
        if j+1<w and field[i][j+1]!="#":
            dist[i*w+j][i*w+j+1]=1
            dist[i*w+j+1][i*w+j]=1
        if i+1<h and field[i+1][j]!="#":
            dist[i*w+j][(i+1)*w+j]=1
            dist[(i+1)*w+j][i*w+j]=1
for i in range(n):
    for j in range(n):
        for k in range(n):
            dist[j][k]=min(dist[j][k],dist[j][i]+dist[i][k])
ans=0
for i in range(n):
    for j in range(n):
        if i==j:
            continue
        if dist[i][j]==inf:
            continue
        ans=max(ans,dist[i][j])
print(ans)
s = list(input())
t = list(input())
s.sort()
t.sort()

sf1 = s[0]
sf2 = s[1]
tf1 = t[-1]
tf2 = t[-2]
sres1 = 0
sres2 = 0
tres1 = 0
tres2 = 0
A = "abcdefghijklmnopqrstuvwxyz"
for i,x in enumerate(A):
    if sf1 == x:
        sres1 = i
    if sf2 == x:
        sres2 = i
    if tf1 == x:
        tres1 = i
    if tf2 == x:
        tres2 = i
if sres1 < tres1:
    print("Yes")
elif sres1 == tres1:
    if sres2 < tres2:
        print("Yes")
    else:
        print("No")
else:
    print("No")

### FIXED CODE ###

s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)

if s < t:
    print("Yes")
else:
    print("No")
n=int(input())
k=int(input())
d=len(str(n))
from math import factorial as f
def c(n):
  if n<2:
    return 0
  else:
    return f(n)//(f(n-2)*f(2))
def kk(n):
  dd=len(str(n))
  s=9*(dd-1)
  s+=int(str(n)[0])
  return s
def kkk(n):
  d=len(str(n))
  s=81*(d-1)*(d-2)//2
  s+=9*(d-1)*(int(str(n)[0])-1)
  s+=kk(int(str(n)[1:]))
  return s

if k==1:
  ans=kk(n)
elif k==2:
  ans=kkk(n)
else:
  t=0
  for i in range(2,d-1):
    t+=c(i)
  ans=729*t
  ans+=81*c(d-1)*(int(str(n)[0])-1)
  ans+=kkk(int(str(n)[1:]))
print(ans)

### FIXED CODE ###

n=int(input())
k=int(input())
d=len(str(n))
from math import factorial as f
def c(n):
  if n<2:
    return 0
  else:
    return f(n)//(f(n-2)*f(2))
def kk(n):
  dd=len(str(n))
  s=9*(dd-1)
  s+=int(str(n)[0])
  return s
def kkk(n):
  d=len(str(n))
  s=81*(d-1)*(d-2)//2
  s+=9*(d-1)*(int(str(n)[0])-1)
  s+=kk(int(str(n)[1:]))
  return s

if d==1 and k!=1:
  print(0)
else:
  if k==1:
    ans=kk(n)
  elif k==2:
    ans=kkk(n)
  else:
    t=0
    for i in range(2,d-1):
      t+=c(i)
    ans=729*t
    ans+=81*c(d-1)*(int(str(n)[0])-1)
    ans+=kkk(int(str(n)[1:]))
  print(ans)
import math
a,b,x = map(int, input().split())
if (x <= (a*a*b)/2):
    p = (2*x)/(a*b)
    print(90-math.degrees(math.atan(p/b)))
else:
    p = 2*(a*a*b - x)/(a*a)
    print(90-math.degrees(math.atan(a/p)))

### FIXED CODE ###

import math
a,b,x = map(int, input().split())
if (x <= (a*a*b)/2):
    p = (2*x)/(a*b)
    print(90-math.degrees(math.atan(p/b)))
elif (x == a*a*b):
    print(0)
    
else:
    p = 2*(a*a*b - x)/(a*a)
    print(90-math.degrees(math.atan(a/p)))
import math

while True:
    a, op, b = map(str, input().split())
    a = int(a)
    b = int(b)
    if 0 < a < 20001 and 0 < b < 20001:
        if op == "+":
            answer = a + b
            print(answer)

        elif op == "-":
            answer = a - b
            print(answer)

        elif op == "*":
            answer = a * b
            print(answer)

        elif op == "/":
            answer = a / b
            print(math.floor(answer))

        elif op == "?":
            break
    else:
        continue

### FIXED CODE ###

import math

while True:
    a, op, b = map(str, input().split())
    a = int(a)
    b = int(b)
    if 0 <= a and b < 20001:
        if op == "+":
            answer = a + b
            print(answer)
        elif op == "-":
            answer = a - b
            print(answer)
        elif op == "*":
            answer = a * b
            print(answer)
        elif op == "/":
            answer = a / b
            print(math.floor(answer))
        elif op == "?":
            break
    else:
        if op == "?":
            break
        else:
            continue
n,k=map(int,input().split())
l=list(map(int,input()))

cnt=1
num=3
while num<n:
  num+=2
  cnt+=1
  
print(cnt)

### FIXED CODE ###

n,k=map(int,input().split())
l=list(map(int,input().split()))

cnt=1
num=k
while num<n:
  num+=(k-1)
  cnt+=1
  
print(cnt)
s=input()
k=int(input())
fl=0
t=0
for i in range(len(s)):
  if s[i]=='1' and fl=0:
    t+=1
  else:
    if fl==0:
      ans=s[i]
      fl=1
if t<=k:
  ans='1'
print(ans)

### FIXED CODE ###

s=input()
k=int(input())
fl=0
t=0
ans='1'
for i in range(len(s)):
  if s[i]=='1' and fl==0:
    t+=1
  else:
    if fl==0:
      ans=s[i]
      fl=1
if t>=k:
  ans='1'
print(ans)
nb = raw_input().split(' ')

x, y, z = int(nb[0]), int(nb[1]), int(nb[2])
ans = int((x-z)/(y+z))
print(ans)

### FIXED CODE ###

nb = input().split(' ')

a, b = int(nb[0],16), int(nb[1], 16)
if a > b:
    print ('>')
elif a < b:
    print ('<')
else:
    print ('=')
K = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(K[n+1])



### FIXED CODE ###

number = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
 
print(number[int(input())-1])
from collections import defaultdict
from math import gcd

P=defaultdict(lambda :0)
n=int(input())
AB=[tuple(map(int,input().split()))for i in range(n)]



for a,b in AB:
    g=gcd(a,b)
    if a<0:
        a//=-g
        b//=-g
    else:
        a//=g
        b//=g
    P[(a,b)]+=1

ans=1
others=n
mod=1000000007
from copy import copy
k=copy(list(P.keys()))
for p in k:
    me=P[p]
    if me==0:
        continue
    a,b=p
    oppidx=(-b,a) if b<0 else (b,-a)
    opp=P[oppidx]
    if P[oppidx]!=0:
        others-=me+opp
        ans*=pow(2,me,mod)+pow(2,opp,mod)-1
        ans%=mod
    P[p]=0
    P[oppidx]=0

ans*=pow(2,others,mod)
ans
ans%=mod

print(ans-1)

### FIXED CODE ###


from collections import defaultdict
from math import gcd

P=defaultdict(lambda :0)
n=int(input())
AB=[tuple(map(int,input().split()))for i in range(n)]

zero=0 #これがいるときは一匹のみ
a0=0 #a0とb0はお互いがペア
b0=0
for a,b in AB:
    g=gcd(a,b)
    if a==0 and b==0:
        zero+=1
    elif a==0:
        a0+=1
    elif b==0:
        b0+=1
    elif a<0:
        a//=-g
        b//=-g
        P[(a,b)]+=1
    else:
        a//=g
        b//=g
        P[(a,b)]+=1

ans=1
others=n-zero-a0-b0
mod=1000000007
from copy import copy
k=copy(list(P.keys()))
for p in k:
    me=P[p]
    if me==0:
        continue
    a,b=p
    oppidx=(-b,a) if b<0 else (b,-a)
    opp=P[oppidx]
    if P[oppidx]!=0:
        others-=me+opp
        ans*=pow(2,me,mod)+pow(2,opp,mod)-1
        ans%=mod
    P[p]=0
    P[oppidx]=0

if a0!=0 and b0!=0:
    ans*=pow(2,a0,mod)+pow(2,b0,mod)-1
    ans%=mod
elif a0!=0 or b0!=0:
    others+=a0+b0

ans*=pow(2,others,mod)
ans%=mod
ans=ans+zero-1
ans%=mod

print(ans)

"""
7
0 1
0 1
1 0
1 0
1 -1
1 1
1 3
"""
N,W=map(int,input().split())
dp=[[0]*(W+1) for _ in range(N+1)]
for i in range(N):
  w,v=map(int,input().split())
  for j in range(W+1):
    if j-w>=0:
      dp[i+1][j]=max(dp[i][j],dp[i][j-w]+v)
    else:
      dp[i+1][j]=dp[i][j]
print(dp[N][W])

### FIXED CODE ###

import numpy as np
N,W = map(int,input().split())
dp = np.full(N*1000+1,W+1)
dp[0] = 0
for _ in range(N):
    w,v = map(int,input().split())
    dp[v:]=np.minimum(dp[v:],dp[:-v]+w)
print(np.where(dp<=W)[0][-1])
a=[int(i) for i in input().split()]
a.sort()
if a=[5, 5, 7]:
	print("YES")
else:
 	print("NO")
 
  

### FIXED CODE ###

a=input().split()
a=[int(i) for i in a]
a.sort()
if a[0]==5 and a[1]==5 and a[2]==7:
	print("YES")
else:
 	print("NO")
A,B,C,K= map(int,input().split())

if A >= K:
  print(K)
elif (A+B) >= K
  print(A)
else:
  nok =K-(A+B)
  print(A-nok)

### FIXED CODE ###

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

if A >= K:
  print(K)
elif (A+B) >= K:
  print(A)
else:
  nok =K-(A+B)
  print(A-nok)
N=int(input())
p=list(map(int,input().split(" ")))
i=0
c=0
while i<N:
    if p[i]==i+1:
        if i<N and p[i+1]==i+2:
            c+=1
            i+=1
        else:
            c+=1
    i+=1

print(c)

### FIXED CODE ###

N=int(input())
p=list(map(int,input().split(" ")))
i=0
c=0
while i<N:
    if p[i]==i+1:
        if i<N-1 and p[i+1]==i+2:
            c+=1
            i+=1
        else:
            c+=1
    i+=1

print(c)
n,v=[int(k) for k in input().split()]
li=[]
for i in range(n):
  li.append([int(k) for k in input().split()])
  
dp=[[0 for i in range(v+1)] for j in range(n+1)]
for a in range(1,n+1):
  for b in range(1,v+1):
    if(li[a-1][0]<=b):
      dp[a][b]=max(li[a-1][1]+dp[a-1][b-li[a-1][0]],dp[a-1][b])
    else:
      dp[a][b]=dp[a-1][b]
print(dp[n][v])      
      
  


### FIXED CODE ###

n,v=[int(k) for k in input().split()]
li=[]
for i in range(n):
  li.append([int(k) for k in input().split()])
  
dp=[[0 for i in range(v+1)] for j in range(n+1)]
for a in range(1,n+1):
  for b in range(1,v+1):
    if(li[a-1][0]<=b):
      dp[a][b]=max(li[a-1][1]+dp[a-1][b-li[a-1][0]],dp[a-1][b])
    else:
      dp[a][b]=dp[a-1][b]
print(dp[n][v])
import sys
sys.setrecursionlimit(10**6)
N,k= map(int,input().split())
A= list(map(int,input().split()))
tree = [0] * (N+1)
M=10**9+7
def BIT_update(tree,x):
    while x <= N:
        tree[x] += 1
        x += x&(-x)
def BIT_sum(tree,x):
    s = 0
    while x:
        s += tree[x]
        x -= x&(-x)
    return s

answer = N*(N-1)//2
c={}
for x in A:
    answer -= BIT_sum(tree,x)
    BIT_update(tree,x)
    if x not in c:
        c[x]=1
    else:
        c[x]+=1
c=sorted(c.items(),key=lambda x:x[0])
d,e=0,0
for j in c:
    d+=e
    e+=j[1]
print(((answer*k+d*(((((k-1)*k)//2))%M))%M))

### FIXED CODE ###

n,k=map(int,input().split())
a,b=list(map(int,input().split())),0
for i,j in enumerate(a):
    for h in a[i:]:
        if j<h:b+=k*(k-1)//2
        elif j>h:b+=k*(k+1)//2
print(b%(10**9+7))
import sys


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

cnt = 0
if D == 0:
    print(N)
else:
    for n in range(1, 10e10):
        val = n/100**D
        if val.is_integer():
            cnt += 1
            if cnt == N:
                print(n)
                sys.exit()



### FIXED CODE ###

D, N = map(int, input().split())
if N == 100:
    N += 1
print(N * 100**D)
a, b, m = map(int, input().split())
A = [map(int, input().split())]
B = [map(int, input().split())]
C = sorted(A)
D = sorted(B)
l = C[0] + D[0]

for i in range(m):
  x, y, c = map(int, input().split())
  k = A[x-1] + B[y-1] -c
  if l > k:
    l = k
  else:
    l = l
print(l)

### FIXED CODE ###

a, b, m = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = sorted(A)
D = sorted(B)
l = C[0] + D[0]
for i in range(m):
  x, y, c = map(int, input().split())
  k = A[x-1] + B[y-1] -c
  if l > k:
    l = k
print(l)
N = int(input())
S = list(input())

right = 0
left = 0

divid = [0]
for s_1 in range(len(S)-1):
    s_2 = s_1+1
    if S[s_1] == ')' and S[s_2] == '(':
        divid.append(s_2)
divid.append(len(S))

for s1,s2 in zip(divid[:-1],divid[1:]):
    S_temp = S[s1:s2]
    right_temp = 0
    left_temp = 0
    for s in S_temp:
        if s == '(':
            left_temp += 1
        if s == ')':
            right_temp += 1    
    
    right += max(0,right_temp - left_temp)
    left += max(0,left_temp - right_temp)
    
#     print(s1,s2,S_temp)
#     print(right,left)
print('('*right+S_+')'*left)

### FIXED CODE ###

N = int(input())
S_ = input()
s=S_

count = 0
new_left = 0
new_right = 0

for si in s:
    if si == '(':
        count += 1
    else:
        count -= 1

        if count == -1:
            count = 0
            new_left += 1

new_right = count
print('(' * new_left + s + ')' * new_right)
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
h = [int(i) for i in input().split()]

h.sort()
tmp = 0
for i in range(n-k, n):
    tmp += h[i]
if k >= n:
    ans = 0
else:
    h.sort()
    tmp = 0
    for i in range(n-k, n):
        tmp += h[i]
    ans = (sum(h) - tmp)
print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
n, k = map(int,input().split())
h = [int(i) for i in input().split()]

if k >= n:
    ans = 0
else:
    h.sort()
    tmp = 0
    for i in range(n-k, n):
        tmp += h[i]
    ans = (sum(h) - tmp)
print(ans)
x, y, a, b, c = map(int, input().split())
p =list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p = sorted(p)
q = sorted(q)

p = p[(len(p)-x):]
q = q[(len(q)-y):]
r.append(p)
r.append(q)
sort(r)
print(sum(r[(len(r)-x-y):]))


### FIXED CODE ###

x, y, a, b, c = map(int, input().split())
p =list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p = sorted(p)
q = sorted(q)

p = p[(len(p)-x):]
q = q[(len(q)-y):]
r = r + p
r = r + q
r = sorted(r)
print(sum(r[(len(r)-x-y):]))
alpha = int(input())
a = [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]

if alpha in a:
  print('A')
else:
  print('a')

### FIXED CODE ###

alpha = input()
if alpha.isupper():
  print('A')
else:
  print('a')
Source Code 

Copy
Copy
i = input()
if '7' in i:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

if "7" in input():
  print('Yes')
else:
  print('No')
def main():
    a, b, k = map(int, input().split())
    from math import gcd
    g = gcd(a, b)

    def yakusuu(a):
        yakusuu = set()
        for i in range(1, int(a**0.5)+1):
            if a % i == 0:
                yakusuu.add(i)
                yakusuu.add(a//i)
        yakusuu = sorted(list(yakusuu))
        return yakusuu

    print(yakusuu(g)[::-1][k-1])


main()


### FIXED CODE ###

a,b,k=map(int,input().split())
print([i for i in reversed(range(1,101)) if a%i==b%i==0][k-1])
import math
 
n = int(input())
answers = []

if n == 0:
  print(':(')
else:
  for i in range(1, n):
    if math.floor(i * 1.08) == n:
      answers.append(i)
      break
  else:
    print(':(')
  
  if len(answers) == 1:
    print(answers[0])
  else:
    print(answers[len(answers) // 2])

### FIXED CODE ###

n = int(input())
 
ans = -1
for i in range(1, n+1):
  if int(i  * 1.08) == n:
    ans = i
if ans == -1:
  print(':(')
else:
  print(ans)
S=map(str,input())
if "A" in S:
    print("Yes")
elif :
    S="AAA"
    print("No")
else :
    print("No")

### FIXED CODE ###





s = input()

if s == 'AAA' or s == 'BBB':
  print('No')
else:
  print('Yes')
n,w=map(int,input().split())
weight=[]
value=[]
for i in range(n):
    q,r=map(int,input().split())
    weight.append(q)
    value.append(r)

dp=[[0 for i in range(110)] for j in range(100100)]

for i in range(0,n):
    for sum_w in range(0,w+1):
        if sum_w-weight[i]>=0:
            dp[i+1][sum_w]=max(dp[i+1][sum_w],dp[i][sum_w-weight[i]]+value[i])
        dp[i+1][sum_w]=max(dp[i][sum_w],dp[i+1][sum_w])

print(dp[n][w])

### FIXED CODE ###

n,w=map(int,input().split())
weight=[]
value=[]
for i in range(n):
    q,r=map(int,input().split())
    weight.append(q)
    value.append(r)

dp=[[0 for i in range(100111)] for j in range(111)]

for i in range(0,n):
    for sum_w in range(0,w+1):
        if sum_w-weight[i]>=0:
            dp[i+1][sum_w]=max(dp[i+1][sum_w],dp[i][sum_w-weight[i]]+value[i])
        dp[i+1][sum_w]=max(dp[i][sum_w],dp[i+1][sum_w])

print(dp[n][w])
D = int(input())

num = 25 - D
s = "Christmas"
s += " Eve" * num

print(s)

### FIXED CODE ###

ab, bc, ca = map(int, input().split())

S = int(ab * bc / 2)
print(S)
import math

N = input().split(" ")
A = int(N[0])
B = int(N[1])
H = int(N[2])
M = int(N[3])

naga = (30 * H) + (M / 2)
mizi = 6 * M

if naga < mizi:
  deg = mizi - naga
elif naga > mizi:
  deg = naga - mizi
if deg > 180:
  deg = 360 - deg

s = (A ** 2) + (B ** 2) - (2 * A * B * math.cos(math.radians(deg)))

s = s**(1/2)
print('{:.20f}'.format(s))

### FIXED CODE ###

import math

N = input().split(" ")
A = int(N[0])
B = int(N[1])
H = int(N[2])
M = int(N[3])

naga = (30 * H) + (M / 2)
mizi = 6 * M

if naga < mizi:
  deg = mizi - naga
elif naga >= mizi:
  deg = naga - mizi
if deg >= 180:
  deg = 360 - deg

s = (A ** 2) + (B ** 2) - (2 * A * B * math.cos(math.radians(deg)))

s = s**(1/2)
print('{:.20f}'.format(s))
N,K = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
S = 0

for i in range(K):
  S = S + p[K]
  
print(S)

### FIXED CODE ###

N,K = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
S = 0
 
for i in range(K):
  S = S + p[i]
  
print(S)