Harryxun/stf_run huggingface dataset:
num = int(raw_input())
n = num % int(len(str(num)))
s1 = [2,4,5,7,9]
s2 = [0,1,6,8]
if n in s1:
  print("hon")
elif n in s2:
  print("pon")
else:
  print("bon")

### FIXED CODE ###

num = input()
s1 = [2,4,5,7,9]
s2 = [0,1,6,8]
if int(num[int(len(str(num)))-1]) in s1:
  print("hon")
elif int(num[int(len(str(num)))-1]) in s2:
  print("pon")
else:
  print("bon")
A, B = map(int, input().split())
B_ = int(B*100)
C = str(A*B_)
D = C[:-2]
E = C[-2:]
D,E
if E == '00':
    print(D)
else:
    print(D+'.'+E)

### FIXED CODE ###

#A,B = 664706138336385, 9.79
A, B = input().split()
A = int(A)
B = float(B)
B_ = round(B*100)
C = A*B_
C_ = str(C)
if C < 100:
    print(0)
else:
    print(C_[:-2])
b=input()
if b==A:
  print(T)
elif b==T:
  print(A)
elif b==G:
  print(C)
else:
  print(G)
  

### FIXED CODE ###

b=input()
if b=="A":
  print("T")
elif b=="T":
  print("A")
elif b=="G":
  print("C")
elif b=="C":
  print("G")
input_int = list(map(int,input().split()))

if (input_int[0] * input_int[1]) % 2 == 0 {
  print("Even")
else{
  print("Odd")
}

### FIXED CODE ###

input_int = list(map(int,input().split()))
 
if input_int[0] * input_int[1] % 2 == 0 :
   print("Even")
else:
  print("Odd")
r = int(input())

print(math.pi* 2 * r)

### FIXED CODE ###

r = int(input())

import math

print(math.pi*2*r)
letter=input()
alphabet="abcdefghijklmnopqrstuvwxyz"
alphabet[i]=letter
print(alphabet[i+1])

### FIXED CODE ###

letter=input()
alphabet="abcdefghijklmnopqrstuvwxyz"
for i in range(len(alphabet)):
  if alphabet[i]==letter:
    print(alphabet[i+1])
a=0
b=0
for i in range(len(N)):
	if N[i] == 'A' or N[i] ==  'T' or N[i] ==  'C' or N[i] ==  'G' :
		a+=1
	else: 
		if a > b: b = a
		a=0

print(b)


### FIXED CODE ###

N = input()
a=0
b=0
for i in range(len(N)):
	if N[i] == 'A' or N[i] ==  'T' or N[i] ==  'C' or N[i] ==  'G' :
		a+=1
	else: 
		if a > b: b = a
		a=0

print(max(b,a))
N,M = map(int,input().split())
l = [list(map(int,input().split())) for i
     in range(N)]
for i in range(N):
  del l[i][0]
if N!=1:
  for i in range(N-1):
    a = set(l[i])&set(l[i+1])
    l[i+1] = a
    print(len(a))
else:


### FIXED CODE ###

N,M = map(int,input().split())
l = [list(map(int,input().split())) for i
     in range(N)]
for i in range(N):
  del l[i][0]

for i in range(N-1):
    a = set(l[i])&set(l[i+1])
    l[i+1] = a
if N==1:
  print(len(l[0])) 
else:
  print(len(a))
n = int(input())
a = list(map(int, input().split()))
cnt = 0
for i in range(a):
    if a[a[i]-1] -1 == i:
        cnt +=1
print(cnt // 2)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
cnt = 0
for i in range(n):
    if a[a[i]-1] -1 == i:
        cnt +=1
print(cnt // 2)
def main(s: str):
    if re.match(r'^([^L][^R])*[^L]$', s):
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    s = input()

    main(s)


### FIXED CODE ###

import re


def main(s: str):
    if re.match(r'^([^L][^R])*[^L]?$', s):
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    s = input()

    main(s)
S=input();print(min(S.count("1"),S.count(0))*2)

### FIXED CODE ###

S=input();print(min(S.count("1"),S.count("0"))*2)
n, m = input().split()
n = int(n)
m = int(m)

print(n!/(2 * (n-2)!) + m!/(2 * (n-2)!))

### FIXED CODE ###

import math
n, m = input().split()
n = int(n)
m = int(m)
x = 0
y = 0
if n > 1:
  x = int(math.factorial(n)/(2 * math.factorial(n-2)))
if m > 1:
  y = int(math.factorial(m)/(2 * math.factorial(m-2)))

print(x+y)
N, A, B, C = map(int, input().split())
l = [int(input()) for i in range(N)]
INF = 10 ** 9

def dfs(cur, a, b, c):
    if cur == N:
        return  abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
    ret0 = dfs(cur + 1, a, b, c)
    ret1 = dfs(cur + 1, a + l[cur], b, c)
    ret2 = dfs(cur + 1, a, b + l[cur], c)
    ret3 = dfs(cur + 1, a, b, c + l[cur])
    return min(ret0, ret1, ret2, ret3)

print(dfs(ret0, ret1, ret2, ret3))


### FIXED CODE ###

N, A, B, C = map(int, input().split())
l = [int(input()) for i in range(N)]
INF = 10 ** 9

def dfs(cur, a, b, c):
    if cur == N:
        return  abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
    ret0 = dfs(cur + 1, a, b, c)
    ret1 = dfs(cur + 1, a + l[cur], b, c) + 10
    ret2 = dfs(cur + 1, a, b + l[cur], c) + 10
    ret3 = dfs(cur + 1, a, b, c + l[cur]) + 10
    return min(ret0, ret1, ret2, ret3)

print(dfs(0, 0, 0, 0))
global MOD,facts,inv
MOD = 998244353

def nCr(n,r):
    global facts,inv
    return (facts[n] * inv[r]) % MOD * inv[n-r] % MOD

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

facts = [0]*(N+10)
facts[0] = facts[1] = 1
for i in range(2,N+1):
    facts[i] = (facts[i-1] * i) % MOD
inv = [0]*(N+10)
inv[N] = pow(facts[N],MOD-2,MOD)
for i in range(N,0,-1):
    inv[i-1] = (inv[i] * i) % MOD

ans = 0
for i in range(N+1):
    bal = K - (i * A)
    m,f = bal % B,bal // B
    if m == 0 and f + i <= 2*N:
        ans = (ans + (nCr(N,i) * nCr(N,f))) % MOD
        
print(ans)


### FIXED CODE ###

global MOD,facts,inv
MOD = 998244353

def nCr(n,r):
    global facts,inv
    return (facts[n] * inv[r]) % MOD * inv[n-r] % MOD

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

facts = [0]*(N+10)
facts[0] = facts[1] = 1
for i in range(2,N+1):
    facts[i] = (facts[i-1] * i) % MOD
inv = [0]*(N+10)
inv[N] = pow(facts[N],MOD-2,MOD)
for i in range(N,0,-1):
    inv[i-1] = (inv[i] * i) % MOD

ans = 0
for i in range(N+1):
    bal = K - (i * A)
    m,f = bal % B,bal // B
    if m == 0 and f <= N and f >= 0:
        ans = (ans + (nCr(N,i) * nCr(N,f))) % MOD
        
print(ans)
#239423 29392 39299 394239932
H, A = map(int, input().split())
ans = H // A + (H % A)/(H % A) * 1
print(round(ans))


### FIXED CODE ###

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

if H % A == 0 :
    ans = H / A
else :
    ans = H // A + 1

print(round(ans))
from collections import defaultdict

inf = float('inf')

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

dd = defaultdict(list)
for _ in range(n):
    t, d = map(int, input().split())
    dd[t].append(d)

for key in dd:
    dd[key].sort(reverse=True)

h1 = []
h2 = []
for key in dd:
    for i, d in enumerate(dd[key]):
        if i == 0:
            h1.append(d)
        else:
            h2.append(d)

if h1:
    h1.sort(reverse=True)
if h2:
    h2.sort(reverse=True)

c1 = [0]
for hh in h1:
    c1.append(c1[-1] + hh)
if len(c1) < k:
    c1.extend([-inf] * (k - len(c1) + 1))

c2 = [0]
for hh in h2:
    c2.append(c2[-1] + hh)
if len(c2) < k:
    c2.extend([-inf] * (k - len(c2) + 1))

# print(h1, c1)
# print(h2, c2)

ans = -inf
for kind in range(1, k + 1):
    # print(kind, c1[kind], c2[k - kind])
    ans = max(ans, c1[kind] + c2[k - kind] + kind * kind)
print(ans)


### FIXED CODE ###

# 解説放送

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

e = [None for _ in range(N + 1)] # 種別の美味しさ
t_kinds_count = 0 # 何種類あるか
rest_length = 0 # 各種の2番手以降の個数の総数

tops = [] # 各種の最大美味しさ
c_tops = [0] # 各種の最大美味しさの累積和
rests = [] # 各種の2番手以降
c_rests = [0] # 各種の2番手以降の累積和

for _ in range(N):
    t, d = map(int, input().split())
    if e[t] is None:
        e[t] = []
        t_kinds_count += 1
    e[t].append(d)


for t in range(1, N + 1):
    if e[t] is None:
        continue
    e[t].sort(reverse=True)
    tops.append(e[t][0])
    rests.extend(e[t][1:])

tops.sort(reverse=True)
rests.sort(reverse=True)

s = 0
for tt in tops:
    s += tt
    c_tops.append(s)

s = 0
for rr in rests:
    s += rr
    c_rests.append(s)
    rest_length += 1

ans = 0
for yy in range(1, min(t_kinds_count, K) + 1):
    if 0 <= K - yy <= rest_length:
        ans = max(ans, c_tops[yy] + c_rests[K - yy] + yy * yy)

# print(e)
# print(tops)
# print(c_tops)
# print(rests)
# print(c_rests)
print(ans)
>>> a,b,c=map(int,input().split())
>>> if a<c and c<b:
	print("Yes")
elif b<c and c<a:
	print("Yes")
else:
	print("No")

### FIXED CODE ###

a,b,c=map(int,input().split())
if a<b:
	if a<c and c<b:
		print("Yes")
	else:
		print("No")
elif b<a:
	if b<c and c<a:
		 print("Yes")
	else:
		 print("No")
else:
	 print("No")
K,X=input().split
if K*2>X:
  print("yes")
else:
  print("no")

### FIXED CODE ###

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

if 500*K >= X:
  print('Yes')
else:
  print('No')
N, Y = map(int,input().split())
y = Y/1000
ans_a = -1
ans_b = -1
for i in range(1,2001):
    for j in range(1,2001):
        if i*9 + j*4 + N == y:
            ans_a = i
            ans_b = j
if ans_a == -1:
    N = -1
print(str(ans_a)+' '+str(ans_b)+' '+str(N-ans_a-ans_b)

### FIXED CODE ###

N, Y = map(int,input().split())
y = Y/1000
ans_a = -1
ans_b = -1
for i in range(N+1):
    for j in range(N-i+1):
        if i*9 + j*4 + N == y:
            ans_a = i
            ans_b = j
if ans_a == -1:
    N = -3
print(str(ans_a)+' '+str(ans_b)+' '+str(N-ans_a-ans_b))
a,b,c,k= map(int,input().split())

if a+b>=k:
  print(min(a,k))
else:
  print(2*a+b-k)

### FIXED CODE ###

s= input()
t=input()

if t[:-1]==s:
  print('Yes')
else:
  print('No')
x = int(input())
det = 1001001001
for i in range(1000000):
    if abs(i**5 - x) < abs(det):
        det = i**5 - x
        a = i
    else:
        break

if det < 0:
    for i in range(-1, -1000000, -1):
        if i**5 == det:
            b = i
            break
elif det == 0:
    b = 0
else:
    for i in range(1000000):
        if i**5 == det:
            b = i
            break


print(a, b)


### FIXED CODE ###

x = int(input())

for i in range(1000):
    for j in range(1000):
        if i**5 - j**5 == x:
            print(i,j)
            exit()
        elif i**5 - (-j)**5 == x:
            print(i,-j)
            exit()
s=input()
for i in range(len(s)):
  if s[i]=="1":
    s[i]="9"
  elif s[i]=="9":
    s[i]="1"

print(s)

### FIXED CODE ###

s=input()
t=s.replace("9","2")
u=t.replace("1","3")
v=u.replace("2","1")
w=v.replace("3","9")

print(w)
def test():
    n=int(input())
    a=list(map(int,input().split()))
    a.sort()
    a.reverse()
    s=list(set(a))
    s.sort()
    s.reverse()
    ans=[]
    v=0
    for i in s:
        if 4<=a.count(i):
            return i*i
        elif 2<=a.count(i)<=3:
            ans.append(i)
            return ans[0]*ans[1]
    return 0
t=test()
print(t)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
from collections import Counter
data=Counter(a)
two_i=[]
four_i=[]
for i,j in data.items():
    if 4<=j:
        four_i.append(i)
    elif 2<=j:
        two_i.append(i)
two_i.sort()
four_i.sort()
two_i.reverse()
four_i.reverse()
if len(four_i)==0:
    four_i.append(0)
if len(two_i)<=1:
    two_i.append(0)
    two_i.append(0)
four_area=four_i[0]*four_i[0]
two_area=two_i[0]*two_i[1]
mix_area=two_i[0]*four_i[0]
print(max(four_area,two_area,mix_area))
def slove():
    import sys
    import fractions
    input = sys.stdin.readline
    a, b = list(map(int, input().rstrip('\n').split()))
    gcd = fractions.gcd(a, b)
    ls = [True] * (gcd + 1)
    ls[0] = False
    ls[1] = False
    c = [1]
    for i in range(2, int(gcd ** 0.5) + 1):
        if ls[i]:
            if a % i == 0 and b % i == 0:
                c.append(i)
            for j in range(i, gcd, i):
                ls[j] = False
    print(len(c))


if __name__ == '__main__':
    slove()


### FIXED CODE ###

def slove():
    import sys
    import fractions
    input = sys.stdin.readline
    a, b = list(map(int, input().rstrip('\n').split()))
    gcd = fractions.gcd(a, b)
    cnt = 1
    for i in range(2, int(gcd ** 0.5) + 1):
        if gcd % i == 0:
            cnt += 1
            while True:
                if gcd % i == 0:
                    gcd //= i
                else:
                    break
    if gcd != 1:
        cnt += 1
    print(cnt)


if __name__ == '__main__':
    slove()
s=input()
k=int(input())
if s[0]=="1":
  print(s[1])
else:
  print(s[0])


### FIXED CODE ###

s=input()
k=int(input())

for i in range(k):
  if s[i]!="1":
    break
print(s[i])
from collections import deque
N = int(input())
g = [[] for i in range(N)]
for i in range(N-1):
  u,v,w = map(int,input().split())
  u -= 1
  v -= 1
  g[u].append([v,w])
  g[v].append([u,w])
q = deque([])
ans = [-1] * N
q.append(0)
ans[0] = 0
while len(q) > 0:
  e = q.popleft()
  for i in g[e]:
    if ans[i[0]] > -1:
      continue
    ans[i[0]] += i[1]
    ans[i[0]] = ans[i[0]] % 2
    q.append(i[0])
for i in range(len(ans)):
  if ans[i]%2 == 1:
    print(1)
    continue
  print(0)


### FIXED CODE ###

N,K = map(int,input().split())
S = list(input())
ans = ""
if S[K-1] == "A":
  S[K-1] = "a"
if S[K-1] == "B":
  S[K-1] = "b"
if S[K-1] == "C":
  S[K-1] = "c"
for n in S:
    ans += n
print(ans)
import sys
 
args = sys.argv
x = int(sys.argv[0])
y = int(sys.argv[1])
if x<10 and y<10:
	print(x*y)
else:
	print('-1')

### FIXED CODE ###

import sys
 
input = sys.stdin.readline().split()
result = 1
for n in input:
  n=int(n)
  if result==-1:
    break
  if n<10:
    result = result * n
  else:
    result=-1
print(result)
N = int(input())
s = sorted([input() for i in range(N)])
M = int(input())
t = sorted([input() for i in range(M)])
a = 0
for i in s:
    for j in t:
        if a < s.count(s[i])-t.count(j):
            a = s.count(s[i])-t.count(j)
print(a)

### FIXED CODE ###

N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for i in range(M)]
maxp = 0
for i in s:
    pre = s.count(i)-t.count(i)
    maxp = max(maxp,pre)
print(maxp)
# -*- coding: utf-8 -*-

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

dp = [[0] * (W+1) for _ in range(N+1)]

for i, z in enumerate(Z):
    #print(i)
    for w in range(W+1):
        if w -z[0] >= 0:
            dp[i+1][w] = max(dp[i][w-z[0]]+z[1], dp[i][w])
        else:
            dp[i+1][w] = dp[i][w]
    #print(dp)

print(max(dp[-1]))


### FIXED CODE ###

# -*- coding: utf-8 -*-

N, W = list(map(int, input().split()))
W_l = []
V_l = []
for i in range(N):
    w, v = list(map(int, input().split()))
    W_l.append(w)
    V_l.append(v)

V_max = sum(V_l)+1
W_max = sum(W_l) +1

#print(V_max, W_max)
dp = [[W+1] * V_max for _ in range(N+1)]
dp[0][0] = 0
for i in range(N):
    #print(i)
    for v in range(V_max):
        if v -V_l[i] >= 0:
            dp[i+1][v] = min(dp[i][v-V_l[i]]+W_l[i], dp[i][v])
        else:
            dp[i+1][v] = dp[i][v]
    #print(dp)
ans = 0
#print(dp[-1])
for v, w in enumerate(dp[-1]):
    if w <= W and ans <= v:
        ans = v
print(ans)
from collections import deque

h, w = map(int, input().split())
p = (input() for i in range(h))

# メモ配列
INF = 10**7
memo = [[INF]*w for i in range(h)]

# 白マスをカウント
wcnt = 0
for i in p:
    for j in i:
        if j == '.':
            wcnt+=1

# 幅探索用キュー初期化
q = deque()
q.append((0, 0))
memo[0][0]  = 0

# 探索用ベクトル
vx = (0, -1, 0, 1)
vy = (-1, 0, 1, 0)

ans = -1
for i in range(INF):
    # キューが空なら終了
    if len(q) == 0:
        break
        
    # キューから一つ取り出す
    x, y = map(int, q.pop())
    
    # ゴールなら終了
    if x == w-1 and y == h-1:
        ans = memo[y][x]
        break
        
    # 4方向の距離を確定して、エンキューする
    for j in range(4):
        nx, ny = x+vx[j], y+vy[j]
        
        # エリア外 or 探索済み or 黒色なら探索しない
        if nx < 0 or w <= nx or ny < 0 or h <= ny or memo[ny][nx] != INF or p[ny][nx] == '#':
            continue
            
        memo[ny][nx] = memo[y][x]+1
        q.appendleft((nx, ny))

if ans == -1:
    print(ans)
else:
    print(wcnt-ans-1)

### FIXED CODE ###

from collections import deque

h, w = map(int, input().split())
p = [input() for i in range(h)]

# メモ配列
INF = 10**7
memo = [[INF]*w for i in range(h)]

# 白マスをカウント
wcnt = 0
for i in p:
    for j in i:
        if j == '.':
            wcnt+=1

# 幅探索用キュー初期化
q = deque()
q.append((0, 0))
memo[0][0]  = 0

# 探索用ベクトル
vx = (0, -1, 0, 1)
vy = (-1, 0, 1, 0)

ans = -1
for i in range(INF):
    # キューが空なら終了
    if len(q) == 0:
        break
        
    # キューから一つ取り出す
    x, y = map(int, q.pop())
    
    # ゴールなら終了
    if x == w-1 and y == h-1:
        ans = memo[y][x]
        break
        
    # 4方向の距離を確定して、エンキューする
    for j in range(4):
        nx, ny = x+vx[j], y+vy[j]
        
        # エリア外 or 探索済み or 黒色なら探索しない
        if nx < 0 or w <= nx or ny < 0 or h <= ny or memo[ny][nx] != INF or p[ny][nx] == '#':
            continue
            
        memo[ny][nx] = memo[y][x]+1
        q.appendleft((nx, ny))

if ans == -1:
    print(ans)
else:
    print(wcnt-ans-1)
N = int(input())

if N <= 10**9:
  List = [0,0,0,1,N,0]
else:
  a = -(-S//(10**9))
  b = a*10**9-S
  List = [0,0,10**9,b,a,1]
  
print(*List)

### FIXED CODE ###

N = int(input())
a = -(-N//(10**9))
b = a*10**9-N
print(0, 0, 10**9, b, 1, a)
N = int(input())
Larray = list(map(int,input().split()))
lmax = max(Larray)
Larray.remove(lmax)
ltot = 0
for i in range(Larray):
  ltot += i
if lmax > ltot:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

N = int(input())
Larray = list(map(int,input().split()))
lmax = max(Larray)
Larray.remove(lmax)
ltot = 0
for i in Larray:
  ltot += i
if lmax < ltot:
  print('Yes')
else:
  print('No')
a, b = map(int, input().split())
print("Odd") if a * b % != 0 else print("Even")

### FIXED CODE ###

a, b = map(int, input().split())
print("Odd") if (a * b) % 2 != 0 else print("Even")
def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        i = 1
        while i*i <= num:
            if num%i == 0:
                divisor_list.append(i)
                divisor_list.append(num//i)

            i += 1
        divisor_list.append(num)

        return sorted(set(divisor_list))


def bin_search(L,Target):
    left = 0
    righ = len(L)

    i = 0
    while left < righ:

        mid  = (left + righ) //2

        if L[mid] <= Target <= L[mid+1]:
            break
        elif L[mid] <= Target:
            left = mid
            righ = righ
        else:
            left = left
            righ = mid

    return mid

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

Target = N
L = make_divisor_list(M)

mid = bin_search(L,Target)

ans = M//L[mid+1]
print(ans)


### FIXED CODE ###

N,M = map(int,input().split())
ans = 1
i = 1
while i*i <= M:
    if M%i == 0 and M//N >= i:
        ans = max(ans,i)
        if M //i *N <= M:
            ans = max(ans,M//i)
    i += 1
print(ans)
N, M = list(map(int, input().split()))

room_dict = {i+1:[] for i in range(N)}
for _ in range(N):
  _a, _b = list(map(int, input().split()))
  room_dict[_a].append(_b)
  room_dict[_b].append(_a)

rooms = set(room_dict.keys())
s_dict = {i+1:None for i in range(1, N)}
traversed_rooms = set([1])

now_rooms = [1]
from operator import add
while now_rooms:
    next_rooms = set()
    for _room in now_rooms:
        traversed_rooms.add(_room) # 訪問済みを保存
        _n_rooms  = [i for i in room_dict[_room] 
                         if (not i in traversed_rooms) and (s_dict[i] is None)]
        for n_room in _n_rooms:
            next_rooms.add(n_room) # 今の次の階層を、次のiteration用に入れる
            s_dict[n_room] = _room # 次の階層は、今の階層への道標を置けば十分
    now_rooms = [i for i in next_rooms if not i in traversed_rooms] # まだ訪れてない部屋を探す
    
print('Yes') # 常に答えは存在する

for i in range(2, N+1):
    print(s_dict[i])

### FIXED CODE ###

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

room_dict = {i+1:[] for i in range(N)}
for _ in range(M):
  _a, _b = list(map(int, input().split()))
  room_dict[_a].append(_b)
  room_dict[_b].append(_a)

rooms = set(room_dict.keys())
s_dict = {i+1:None for i in range(1, N)}
traversed_rooms = set([1])

now_rooms = [1]
from operator import add
while now_rooms:
    next_rooms = set()
    for _room in now_rooms:
        traversed_rooms.add(_room) # 訪問済みを保存
        _n_rooms  = [i for i in room_dict[_room] 
                         if (not i in traversed_rooms) and (s_dict[i] is None)]
        for n_room in _n_rooms:
            next_rooms.add(n_room) # 今の次の階層を、次のiteration用に入れる
            s_dict[n_room] = _room # 次の階層は、今の階層への道標を置けば十分
    now_rooms = [i for i in next_rooms if not i in traversed_rooms] # まだ訪れてない部屋を探す
    
print('Yes') # 常に答えは存在する

for i in range(2, N+1):
    print(s_dict[i])
s = input()
K = int(input())
substring = []
for i in range(len(s) + 1):
	for j in range(i + 1, len(s) + 1):
		substring.append(s[i:j])
substring = list(set(substring))
substring.sort()
print(substring[K - 1])

### FIXED CODE ###

s = input()
K = int(input())
substr = set()
for i in range(len(s)):
    for j in range(i+1, i+K+1):
        substr.add(s[i:j])
print(sorted(substr)[K-1])
import sys
sys.setrecursionlimit(10**6);l=lambda:map(int, input().split());n=int(input());s=[0for _ in[0]*n];j=[[]for _ in[0]*n]
for _ in range(n-1):a,b,c=l();j[a-1].append([b-1,c]);j[b-1].append([a-1,c])
def f(v,p,d):
 s[v]=d
 for i,c in j[v]:
  if i==p:
   continue
  f(i,v,d+c)
q,k=l()
dfs(k-1,-1,0)
for _ in [0]*q:x,y=l();print(s[x-1]+s[y-1])

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())

dis = [ 0 for _ in range(n)]  # 距離
adj = [[] for _ in range(n)] # 隣接リスト

for _ in range(n-1):
    a, b, c = map(int, input().split())
    a -= 1;b-= 1
    adj[a].append([b, c])
    adj[b].append([a, c])

# v; 現在の頂点
# p; vの親
# d; 現在の距離
def dfs(v, p, d):
    dis[v] = d
    for i, c in adj[v]:
        if i == p:
            continue
        dfs(i, v, d+c)

q, k = map(int, input().split())
k -= 1

dfs(k, -1, 0)

for _ in range(q):
    x, y = map(int, input().split())
    x -= 1;y -= 1
    print(dis[x] + dis[y])
A, B, K = map(int, input().split())
Z = list(range(A, B+1))
Z = Z[:K] + Z[-K:]
Z = set(Z)
Z = sorted(list(Z))
for z in Z:
    print(z)

### FIXED CODE ###

A, B, K = map(int, input().split())
ans = []
for a in range(A, min(A+K, B+1)):
    ans.append(a)
for b in range(max(A+K, B-K+1), B+1):
    ans.append(b)
print(*ans, sep="\n")
N = int(input())

p = []

for i in range(N):
    X1, Y1, H1 = map(int, input().split())
    if H1 != 0:
        p.append([X1, Y1, H1])

if len(p) == 1:
    print(p[0][0], p[0][1], p[0][2])
    exit()


for i in range(101):
    for j in range(101):
        h = -1
        fg = True
        for t in p:
            if h == -1:
                h = t[2] + abs(i - t[0]) + abs(j - t[1])

            else:
                ht = t[2] + abs(i - t[0]) + abs(j - t[1])
                if h == ht:
                    h = ht
                else:
                    fg = False
                    break

        if fg:
            print(i, j, h)
            exit()










### FIXED CODE ###

N = int(input())
if N == 1:
    print('Hello World')
else:
    A = int(input())
    B = int(input())
    print(A+B)
K, X = map(int, input().split())
print("Yes" if 500*K > = X else "No")


### FIXED CODE ###

K, X = map(int, input().split())
print("Yes" if 500*K >= X else "No")
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,w=[int(k) for k in input().split()]
li=[]
 
 
ans=0
for i in range(n):
    li.append([int(k) for k in input().split()])
dp=[[0 for i in range(100001)] for j in range(n+1)]
for i in range(1,100001):
    dp[0][i]=10**10
dp[0][0]=0    
for a in range(1,n+1):
    for b in range(0,100001):
        if(li[a-1][1]<=b):
            x=li[a-1][0]+dp[a-1][b-li[a-1][1]]
            y=dp[a-1][b]
            dp[a][b]=min(x,y)
        else:
            dp[a][b]=dp[a-1][b]
        if dp[a][b]<=w:
          ans=max(ans,b)
 
 
print(ans)
N,X=input().split()
N=int(N)
X=int(X)

x = [int(i) for i in input().split()]
x.append(X)
x.sort()

de=[]#deference 差
for i in range( 0, len(x)-1 ):
    dei=x[i+1]-x[i]
    if(dei>0):
        de.append(dei)

#最大公約数だった
#その数を作る素因数をすべて抜き出し、
#一致するものをすべて抜き出せばできる
import math
gcd=de[0]#最大公約数
for i in range(1,len(de)):
    gcd=math.gcd(gcd,de[i])

print(gcd)

### FIXED CODE ###

#import math
import fractions

N,X=input().split()
N=int(N)
X=int(X)
x = [int(i) for i in input().split()]
x.append(X)
x.sort()
de=[]#deference 差
for i in range( 0, len(x)-1 ):
    dei=x[i+1]-x[i]
    if(dei>0):
        de.append(dei)

#最大公約数だった
#その数を作る素因数をすべて抜き出し、
#一致するものをすべて抜き出せばできる
gcddd=de[0]#最大公約数
for i in range(1,len(de)):
    gcddd=fractions.gcd(gcddd,de[i])
print(gcddd)