Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(10 ** 6)


def input():
    return sys.stdin.readline()[:-1]


def dfs(now, point):
    if K in tree[now-1]:
        point += tree_c[now-1][K]
        return point
    else:
        for next_node in tree[now-1]:
            if zumi[next_node-1] == -1:
                tmp_p = point+tree_c[now-1][next_node]
                return dfs(next_node, tmp_p)


N = int(input())
tree = [{} for i in range(N)]
tree_c = [{} for i in range(N)]
for i in range(N-1):
    a, b, c = map(int, input().split())
    tree[a-1][b] = True
    tree[b-1][a] = True
    tree_c[a-1][b] = c
    tree_c[b-1][a] = c
Q, K = map(int, input().split())

for _ in range(Q):
    x, y = map(int, input().split())
    zumi = [-1]*N
    zumi[x-1] = 0
    ans = dfs(x, 0)

    zumi = [-1]*N
    zumi[y-1] = 0
    ans += dfs(y, 0)
    print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


# Kから順に探索して、Kからの距離を求める
def dfs(v, parent=-1, distance=0):
    # Kから現在の位置までの距離を記録する
    sum_distance[v] = distance
    for i, j in tree[v]:
        if i == parent:
            continue
        dfs(i, v, distance+j)


N = int(input())

tree = [[] * N for i in range(N)]
for _ in range(N-1):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    tree[a].append([b, c])
    tree[b].append([a, c])

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

# 事前に各頂点から頂点Kまでの距離を求める
sum_distance = [0]*N
dfs(K-1)

# クエリを処理する。xからKまでとyからKまでの距離の合計を求める
for _ in range(Q):
    x, y = map(int, input().split())
    print(sum_distance[x-1]+sum_distance[y-1])
W = raw_input().lower()
T= []
while True:
    t = input()
    if t == "END_OF_TEXT":
        break
    else:
        T += t.lower().split()
print(T)
print(T.count(W))

### FIXED CODE ###

W = input().lower()
count = 0
while True:
    a = input()
    if a == "END_OF_TEXT":
        break
    a = a.lower()
    a = a.split()
    for i in range(len(a)):
        if W == a[i]:
            count += 1          
print(count)
from math import gcd
from functools import reduce

def get_gcd(number_list):
    return reduce(gcd, number_list)

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

gcd_list = []
for i in range(N):
    tmp_list = Numbers[:i] + Numbers[i + 1:]
    gcd_list.append(get_gcd(tmp_list))
print(int(max(gcd_list)))

### FIXED CODE ###

from functools import reduce
from itertools import combinations
from fractions import gcd

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


Left = [0] * (N + 1)
Right = [0] * (N + 1)

for i in range(N):
    Left[i + 1] = gcd(Left[i], A[i])
    Right[N - i - 1] = gcd(Right[N - i], A[N - i - 1])
ans = 0
for i in range(N):
    ans = max(ans, gcd(Left[i], Right[i + 1]))
    
print(ans)
data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]

# ??\?????????????????????????????§????????????????????????????????????
count = int(input(1))
for c in range(count):
    c, f, r, v = [int(1) for i in input().split]
    data[b - 1][f - 1][r - 1] += v


for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')

        print()

    if bi < 3:
        print('#' * 20)

### FIXED CODE ###

data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]
    
count = int(input())
for c in range(count):
    b,f,r,v = [int(i) for i in input().split()]
    data[b-1] [f-1] [r-1] += v
    
for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
        print()
    if bi < 3:
        print('#' * 20)
import sys

print sys.argv[1] ** 3

### FIXED CODE ###

print(int(input())**3)
a=int(input())
b=int(input())
if a<b:
    print('a<b')
elif a>b:
    print('a>b')
else:
    print('a=b')

### FIXED CODE ###

a, b = map(int, input().split())
if (a > b):
	print("a > b")
elif (a < b):
	print("a < b")
elif (a == b):
	print("a == b")
n=int(input())
h=list(map(int,input().split()))
l=[]
a=0
for i in range(n-1):
    if h[i]>=h[i+1]:
        a+=1
    else:
        l.append(a)
        a=0
a=0
h.reverse()
for i in range(n-1):
    if h[i]<=h[i+1]:
        a+=1
    else:
        l.append(a)
        a=0
print(max(l))

### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
l=[0]*n
for i in range(1,n):
    if h[i]<=h[i-1]:
        l[i]=1+l[i-1]
print(max(l))
N = int(input())
w_list = ""
is_cor = True
for i in range(N):
  w_list[i] = input()
a = w_list[0]
for i in range(1, N-1):
  b = w_list
  b[i] = 0
  if a[len(a)-1] != w_list[i][0] or w_list[i] in b:
    print("No")
    is_cor = False
    break
if is_cor:
  print("Yes")

### FIXED CODE ###

N = int(input())
w_list = [""]*N
is_cor = True
for i in range(N):
  w_list[i] = input()
for i in range(N-1):
  b = w_list.copy()
  b[i] = ""
  if w_list[i][len(w_list[i])-1] != w_list[i+1][0] or w_list[i] in b:
    print("No")
    is_cor = False
    break
if is_cor:
  print("Yes")
# -*- coding: utf-8 -*-
n = str(input())
S = n.replace(1,9).replace(9,1)
print(S)

### FIXED CODE ###

# -*- coding utf-8 -*-
n = str(input())
S = n.replace("1","8")
T = S.replace("9","1")
U = T.replace("8","9")
print(U)
n = int(input())

if (n[0] == n[1]) and (n[1] == n[2]):
  print('Yes')
elif (n[1] == n[2]) and (n[2] == n[4]):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n = input()

if (n[0] == n[1]) and (n[1] == n[2]):
  print('Yes')
elif (n[1] == n[2]) and (n[2] == n[3]):
  print('Yes')
else:
  print('No')
N,M=[int(i) for i in input().split()]
PY=[[] for _ in range(N)]
py=[]

for i in range(M):
    p,y=[int(i) for i in input().split()]
    py.append((p,y))
    PY[p-1].append(y)

for i in range(N):
    PY[i].sort()

for i in range(M):
    p,y=py.pop(0)
    #print(PY[p].index(y))
    p_zero=6-len(str(p))
    y_zero=6-len(str(PY[p].index(y)))
    print("0"*p_zero + str(p) + "0"*y_zero + str(PY[p].index(y)+1))


### FIXED CODE ###

N,M=[int(i) for i in input().split()]
PY=[[] for _ in range(N)]
py=[]

for i in range(M):
    p,y=[int(i) for i in input().split()]
    PY[p-1].append((y,i))

ans=[None]*M
for j,py in enumerate(PY): #jが県番号
    py.sort()
    for k,(y,i) in enumerate(py):
        ans[i]=str(j+1).zfill(6) + str(k+1).zfill(6)

print(*ans,sep="\n")
L,R=map(int,input().split())
min=0
result=[]
num_range=R-L
if L>=2019 and R>=2019:
    for i in range(num_range-1):
        for j in range(i+1,num_range):
            result.append((L+i-2019)*(L+j-2019))
    result.sort()
elif L<2019 and R<2019:
    result.append(L*R)
print(result[0])

### FIXED CODE ###

L,R=map(int,input().split())
if R-L>=2018:
    print(0)
else:
    ans=2019
    for i in range(L,R):
        for j in range(i+1,R+1):
            ans=min(ans,i*j%2019)
    print(ans)
N = int(input())
A = list(map(int, input().split()))
M = min(A)

if M = 1:
    A.pop(1)
tmp = 1
for i in reversed(range(2,M+1)):
    count = 0
    memo = 0
    for j in range():
        if A[j]%i != 0:
            count += 1
            memo = j
            if count > 1:
                break
    if count <= 1:
        tmp = i
        break
        

print(tmp)



### FIXED CODE ###

def gcd(a,b):
    if a <= b:
        a,b = b,a
    if b == 0:
        return a
    if a%b == 0:
        return b
    else:
        return gcd(b,a%b)

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

L_gcd = [0]*(N+1)
R_gcd = [0]*(N+1)

for i in range(N):
    L_gcd[i+1] = gcd(L_gcd[i],A[i])
    R_gcd[N-i-1] = gcd(R_gcd[N-i],A[N-i-1])

ans = 0
for i in range(N):
    if gcd(L_gcd[i],R_gcd[i+1])>ans:
        ans = gcd(L_gcd[i],R_gcd[i+1])
    
print(ans)
class UnionFind():
  def __init__(self, n):
    self.n = n
    self.root = [-1]*n
    self.rank = [0]*n
    
  def find_root(self, e):
    if self.root[e] < 0:
      return e
    else:
      r = self.find_root(self.root[e])
      self.root[e] = r
      return r
    
  def combine(self, e1, e2):
    root1 = self.find_root(e1)
    root2 = self.find_root(e2)
    if root1 == root2:
      pass
    elif self.rank[root1] < self.rank[root2]:
      self.root[root1] += self.root[root2]
      self.root[root2] = root1
      self.rank[root1] = self.rank[root2] + 1
    elif self.rank[root2] < self.rank[root1]:
      self.root[root2] += self.root[root1]
      self.root[root1] = root2
      self.rank[root2] = self.rank[root1] + 1
    else:
      self.root[root2] += self.root[root1]
      self.root[root1] = root2
      self.rank[root2] += 1
      
  def in_the_same_group(self, e1, e2):
      r1 = self.find_root(e1)
      r2 = self.find_root(e2)
      if r1 == r2:
        return True
      return False
  

NMK = input().split()
N = int(NMK[0])
M = int(NMK[1])
K = int(NMK[2])
uf = UnionFind(N)
from collections import defaultdict

friend_list = [0]*n
for _ in range(M):
  AB = input().split()
  A = int(AB[0])-1
  B = int(AB[1])-1
  uf.combine(A,B)
  friend_list[A] += 1
  friend_list[B] += 1

block_list = [0]*n
for _ in range(K):
  CD = input().split()
  C = int(CD[0])-1
  D = int(CD[1])-1
  if uf.in_the_same_group(C, D):
    block_list[C] += 1
    block_list[D] += 1

cnt = defaultdict(int)
ans = []
for i in range(N):
  cnt[i] = -uf.root[uf.find_root(i)] - 1 - friend_list[i] - block_list[i]
  ans.append(str(cnt[i]))

print(" ".join(ans))

### FIXED CODE ###

class UnionFind():
 def __init__(self,n):
   self.n=n
   self.root=[-1]*(n+1)
   self.rank=[0]*(n+1)
 def FindRoot(self,x):
   if self.root[x]<0:
     return x
   else:
     self.root[x]=self.FindRoot(self.root[x])
     return self.root[x]
 def Unite(self,x,y):
   x=self.FindRoot(x)
   y=self.FindRoot(y)
   if x==y:
     return
   else:
     if self.rank[x]>self.rank[y]:
       self.root[x]+=self.root[y]
       self.root[y]=x
     elif self.rank[x]<=self.rank[y]:
       self.root[y]+=self.root[x]
       self.root[x]=y
       if self.rank[x]==self.rank[y]:
         self.rank[y]+=1
 def isSameGroup(self,x,y):
   return self.FindRoot(x)==self.FindRoot(y)
 def Count(self,x):
   return -self.root[self.FindRoot(x)]
 
n,m,k=map(int,input().split())
t=UnionFind(n+1)
cnt=[0]*(n+1) #各iについて、iと同一の連結成分に属する友達関係の人、ブロック関係の人の数を数える
for _ in range(m):
 a,b=map(int,input().split())
 cnt[a]+=1 #各iについて、iと同一の連結成分に属する友達関係の人の数を数える
 cnt[b]+=1
 t.Unite(a,b)
for _ in range(k):
 a,b=map(int,input().split())
 if t.isSameGroup(a,b)==True:
   cnt[a]+=1 #各iについて、iと同一の連結成分に属するブロック関係の人の数を数える
   cnt[b]+=1
ans=[0]*(n+1)
for i in range(1,n+1):
 ans[i]=(t.Count(i)-1)-cnt[i] #答えは(各iが属する連結成分のサイズ)-1-((iと同一の連結成分に含まれているiと友達関係にある人の数)+(iと同一の連結成分に含まれているiとブロック関係にある人の数)となる
print(*ans[1:])
n,w = map(int,input().split())
wv=[]
for _ in range(n):
  w,v=map(int,input().split())
  wv.append([w,v])

dp=[[0 for i in range(w+1)]for j in range(n+1)]
for i in range(1,n+1):
  for j in range(1,w+1):
    if j-h[i]<0:
      dp[i][w]=dp[i-1][w]
    else:
      dp[i][w]=max(dp[i-1][w-wv[i][0]],dp[i-1][w])

print(dp[n][w])

### FIXED CODE ###

n,w=map(int,input().split())
P=[]
for _ in range(n):
  iw,iv=map(int,input().split())
  P.append([iw,iv])
INF=float('inf')
 
dp=[[0 for i in range(w+1)] for j in range(n+1)]
 
for i in range(1,n+1):
  for j in range(1,w+1):
    if j-P[i-1][0]>=0:
      dp[i][j]=max(dp[i-1][j],dp[i-1][j-P[i-1][0]]+P[i-1][1])
    else:
      dp[i][j]=dp[i-1][j]
print(dp[n][w])
N = int(input())
A = int(input())
B = int(input())
if N ==1:
  print('Hello World')
else:
  print(A+B)

### FIXED CODE ###

N = int(input())
if N ==1:
  print('Hello World')
else:
  A = int(input())
  B = int(input())
  print(A+B)
a = input()
c = 0
for i in c:
  if i=="1":
    c+=1
print(c)

### FIXED CODE ###

a = input()
c = 0
for i in a:
  if i=="1":
    c+=1
print(c)
"""
author : halo2halo
date : 10, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buf"""
author : halo2halo
date : 11, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M = map(int, read().split())
S = N + M

print(S // 2 if S % 2 == 0 else 'IMPOSSIBLE')
fer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M = map(int, read().split())
S = N + M

print(S // 2 if S % 2 == 0 else 'IMPOSSIBLE')


### FIXED CODE ###

"""
author : halo2halo
date : 10, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M = map(int, read().split())
S = N + M

print(S // 2 if S % 2 == 0 else 'IMPOSSIBLE')
N,X = map(int,input().split(" "))
l_list = input().split()

count = 1
d = 0
for i in range(N):
        d_a = d + int(l_list[i])
        d = d_a
        if d_a <= X:
                count +=1
        else:
                print(count)
            　　break

### FIXED CODE ###

N,X = map(int,input().split(" "))
l_list = input().split()

count = 1
d = 0
for i in range(N):
        da = d + int(l_list[i])
        d = da
        if da <= X:
                count +=1
        else:

                print(count)
                break
        if count == int(N) + 1:
                print(count)
S = list(input())
S.reverse()
S = "".join(S)
ans = "YES"
while len(S) > 0:
        print(S)
        if S[:5] == "maerd" or S[:5] == "esare":
                S = S[5:]
        elif S[:6] == "resare":
                S = S[6:]
        elif S[:7] == "remaerd":
                S = S[7:]
        else:
                ans = "NO"
                break
print(ans)

### FIXED CODE ###

S = list(input())
S.reverse()
S = "".join(S)
ans = "YES"
while len(S) > 0:
        if S[:5] == "maerd" or S[:5] == "esare":
                S = S[5:]
        elif S[:6] == "resare":
                S = S[6:]
        elif S[:7] == "remaerd":
                S = S[7:]
        else:
                ans = "NO"
                break
print(ans)
A,B=map(int,input().split())
cmt=0
while True:
  if (A-1)*cnt+1>=B:
    break
  cnt+=1
print(cnt)

### FIXED CODE ###

A,B=map(int,input().split())
cnt=0
while True:
  if (A-1)*cnt+1>=B:
    break
  cnt+=1
print(cnt)
def search(n, step, rec, seq, k):
	if rec[n] != -1:
		c = step - rec[n]
		sim = (k - rec[n]) % c
		v = n
		for i in range(sim):
			v = seq[v] - 1
		print(v+1)
		return
	rec[n] = step
	search(seq[n] - 1, step + 1, rec, seq, k)

def resolve():
	n, k = map(int, input().split())
	seq = list(map(int, input().split()))
	rec = [-1]*n
	search(0, 0, rec, seq, k)
resolve()

### FIXED CODE ###

import sys
from io import StringIO
import unittest

sys.setrecursionlimit(10**5*2)

def search(u, n, g, disc, k):
    if disc[u] != None:
        circles = n - disc[u]
        v = (k - disc[u]) % circles
        ans = u
        if n > k:
            ans = 0
            for _ in range(k):
                ans = g[ans]
            return ans + 1
        for i in range(v):
            ans = g[ans]
        return ans + 1
    disc[u] = n
    return search(g[u], n+1, g, disc, k)

def resolve():
    n, k = map(int, input().split())
    g = list(map(lambda x: int(x) - 1, input().split()))
    disc = [None]*n
    v = search(0, 0, g, disc, k)
    print(v)
resolve()
n = int(input())
if n >= 30:
  prtin('Yes')
 else:
  print('No')

### FIXED CODE ###

n = int(input())
if n < 30:
  print("No")
else:
  print("Yes")
def abc145_c():    
    n = int(input())
    xy = [list(map(int,input().split())) for i in range(n)]
    ans = 0
    for i in range(n):
        for j in range(n):
            cnt += 1
            ans += ((xy[i][0] - xy[j][0])** 2 + (xy[i][1] - xy[j][1])** 2)**0.5
    print(ans / n)
    
if __name__ == '__main__':
    abc145_c()

### FIXED CODE ###

def abc145_c():    
    n = int(input())
    xy = [list(map(int,input().split())) for i in range(n)]
    ans = 0
    for i in range(n):
        for j in range(n):
            ans += ((xy[i][0] - xy[j][0])** 2 + (xy[i][1] - xy[j][1])** 2)**0.5
    print(ans / n)
    
if __name__ == '__main__':
    abc145_c()
from copy import deepcopy

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def gcd_mul(numbers):
    s = gcd(numbers[0], numbers[1])
    for i in range(2, len(numbers)) :
        s = gcd(s, numbers[i])
    return(s)

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

ans = 0
A2 = deepcopy(A)
for i in range(N) :
    del A[i]
    g = gcd_mul(A)
    if g > ans :
        ans = g
    A = deepcopy(A2)
print(ans)

### FIXED CODE ###

import fractions # for python 3.4.3

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

gcd_l = [0]
gcd_r = [0]
for i in range(N):
    gcd_l.append(fractions.gcd(gcd_l[i], A[i]))
    gcd_r.append(fractions.gcd(gcd_r[i], A[-(i+1)]))
    #print(gcd_l)
    #print(gcd_r)
gcd_r = gcd_r[::-1]

ans = []
for i in range(N):
    ans.append(fractions.gcd(gcd_l[i], gcd_r[i+1]))

print(max(ans))
S = input()
ls = ['k', 'e', 'y', 'e', 'n', 'c', 'e']
is_ng = True
for i in range(len(S)-len(ls)+1):
    if S[i] == 'k':
        idx = 0
        tmp = 0
        for j in range(i, len(S)):
            if S[j] == ls[idx]:
                if tmp == 1:
                    tmp = 2
                idx += 1
            else:
                if tmp == 0:
                    tmp = 1
                elif tmp==2:
                    break
                continue
            if idx == len(ls):
                is_ng = False
print('YNEOS'[is_ng::2])

### FIXED CODE ###

S = input()
ls = ['k', 'e', 'y', 'e', 'n', 'c', 'e']
is_ng = True
idx = 0
tmp = 0
for i in range(len(ls)):
    l = S[:i]
    r = S[-len(ls)+i:]
    if l+r == 'keyence':
        is_ng=False

print('YNEOS'[is_ng::2])
s = input()
t = input()

print(t+s)

### FIXED CODE ###

s,t = input().split()

print(t+s)
N = int(input())
X = input().strip()
C = X.count("1")
D = int(X, 2)
M = D % C
Mm, Mp = 0, D % (C+1)
if C > 0:
    Mm = D % (C-1)

p = [0]*(2*10**5+2)
for i in range(1, len(p)):
    n = i
    while True:
        b = bin(n).count("1")
        if b <= 0:
            break
        p[i] += 1
        n = n % b
        if p[n] > 0:
            p[i] += p[n]
            break

for i in range(1, N+1):
    m = 0
    c = C
    if X[i-1] == "1":
        c -= 1
        if c == 0:
            print(0)
            continue
        m = Mm
        d = pow(2, N-i, c)
        d = (m-d+c) % c
    else:
        c += 1
        m = Mp
        d = pow(2, N-i, c)
        d = (m+d) % c

    print(p[d]+1)


### FIXED CODE ###

N = int(input())
X = input().strip()
C = X.count("1")
D = int(X, 2)
Mm, Mp = 0, D % (C+1)
if C > 1:
    Mm = D % (C-1)

p = [0]*(2*10**5+2)
for i in range(1, len(p)):
    n = i
    while True:
        b = bin(n).count("1")
        if b <= 0:
            break
        p[i] += 1
        n = n % b

for i in range(1, N+1):
    c = C
    if X[i-1] == "1":
        c -= 1
        if c == 0:
            print(0)
            continue
        m = Mm
        d = pow(2, N-i, c)
        d = (m-d+c) % c
    else:
        c += 1
        m = Mp
        d = pow(2, N-i, c)
        d = (m+d) % c

    print(p[d]+1)
K, N = map(int, input().split())
A = sorted(map(int, input().split()))

length = K//2
for i in range(N-1):
    length = max(A[i+1] - A[i], length)
    if lenghth == A[i+1] - A[i]:
        ans = A[i] + K - A[i+1]
      
if length <= K//2:
    ans = A[-1] - A[0]
print(ans)

### FIXED CODE ###

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

length = A[0] + K - A[-1]
for i in range(N-1):
    length = max(A[i+1] - A[i] , length)
    if length == A[i+1] - A[i]:
        ans = A[i] + K - A[i+1]
      
if length == A[0] + K - A[-1]:
    ans = A[-1] - A[0]
print(ans)
sd=input()
t=input()
n=len(sd)
m=len(t)
if n<m:
    print("UNRESTORABLE")
    exit(0)
for i in range(n-m,-1,-1):
    t_kana=sd[i:i+m]
    for j in range(m):
        if j==m :
            print(sd[:i]+t+sd[i+len(t):]).replace("?","a")
        if t_kana=="?":
            continue
        elif t_kamo[j]!=t[j]:
            break
print("UNRESTORABLE")

### FIXED CODE ###

sd=input()
t=input()
n=len(sd)
m=len(t)
if n<m:
    print("UNRESTORABLE")
    exit(0)
for i in range(n-m,-1,-1):
    t_kana=sd[i:i+m]
    for j in range(m+1):
        if j==m :
            print((sd[:i]+t+sd[i+len(t):]).replace("?","a"))
            exit(0)
        if t_kana[j]=="?":
            continue
        elif t_kana[j]!=t[j]:
            break
print("UNRESTORABLE")
s=set(list(input()))
a='abcdefghijklmnopqrstuvwxyz'
b=set()
for i in range(26):
    b.append(str(a[i]))
if s==b:
    print('None')
else:
    print(b-s)


### FIXED CODE ###

s=set(list(input()))
a=set(list('abcdefghijklmnopqrstuvwxyz'))

if s==a:
    print('None')
else:
    b=sorted(list(a-s))
    print(str(b[0]))
def f(b,n):
  if b>n:
    return n
  else:
    return f(b,n//b)+n%b

n=int(input())
s=int(input())
if s>n:
  print(-1)
elif s==n:
  print(n+1)
else:
  ans=0
  for i in range(2,int(n**0.5)+1):
    if f(i,n)==s:
      ans=i
      break
  if ans!=0:
    print(ans)
  else:
    for i in range(1,int(n**0.5)+1):
      tb=(n-s)//i+1
      if f(tb,n)==s:
        ans=tb
        break
    if ans!=0:
      print(ans)
    else:
      print(-1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)

def f(b,n):
  if b>n:
    return n
  else:
    return f(b,n//b)+n%b

n=int(input())
s=int(input())
if s>n:
  print(-1)
elif s==n:
  print(n+1)
else:
  ans=10**18
  for i in range(2,int(n**0.5)+1):
    if f(i,n)==s:
      ans=i
      break
  if ans!=10**18:
    print(ans)
  else:
    for i in range(1,int(n**0.5)+1):
      tb=(n-s)//i+1
      if tb==1:
        continue
      if f(tb,n)==s:
        ans=min(ans,tb)
    if ans!=10**18:
      print(ans)
    else:
      print(-1)
N,A,B,C=map(int,input().split())
l=[int(input()) for i in range(N)]
inf=10**9
def dfs(d,a,b,c):
    if d==n:#合成完了
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else inf #無からは作れない#0に合成するのにmpは使わないので-30
    ret0=dfs(d+1,a,b,c)#l[d]を使わない
    ret1=dfs(d+1,a+l[d],b,c)+10#l[d]をAに
    ret2=dfs(d+1,a,b+l[d],c)+10#l[d]をBに
    ret3=dfs(d+1,a,b,c+l[d])+10#l[d]をCに
    return min(ret0,ret1,ret2,ret3)
print(dfs(0,0,0,0))

### FIXED CODE ###

N,A,B,C=map(int,input().split())
l=[int(input()) for i in range(N)]
inf=10**9
def dfs(d,a,b,c):
    if d==N:#合成完了
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else inf #無からは作れない#0に合成するのにmpは使わないので-30
    ret0=dfs(d+1,a,b,c)#l[d]を使わない
    ret1=dfs(d+1,a+l[d],b,c)+10#l[d]をAに
    ret2=dfs(d+1,a,b+l[d],c)+10#l[d]をBに
    ret3=dfs(d+1,a,b,c+l[d])+10#l[d]をCに
    ans=min(ret0,ret1,ret2,ret3)
    return ans
print(dfs(0,0,0,0))
from sys import stdin
import numpy as np
import itertools
N,D = [int(x) for x in stdin.readline().rstrip().split()]
data = []
for _ in range(N):
    data.append([int(x) for x in stdin.readline().rstrip().split()] + [_])

ans = 0
for j in list(itertools.product(data,repeat=2)):
    tot = 0
    #print(j)
    for k,l in zip(j[0][:D] , j[1][:D]):
        tot += abs(k-l)**2
        #print(tot)
    if j[0][-1] < j[1][-1]:
        if np.sqrt(tot).is_integer():
            ans += 1
print(ans)

### FIXED CODE ###

from sys import stdin
N,A,B = [int(x) for x in stdin.readline().rstrip().split()]
print(min(N*A,B))
n,k=map(int,input().split())
l=[i for i in str(input())]

l[k]=l[k].lower()

print(''.join(l))

### FIXED CODE ###

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

l[k-1]=l[k-1].lower()

print(''.join(l))
# vim: fileencoding=utf-8


def main():
    s = input()
    p = 700
    if s[0] == 'o';
        p += 100
    if s[1] == 'o';
        p += 100
    if s[2] == 'o';
        p += 100
    print(p)


if __name__ == '__main__':
    main()


### FIXED CODE ###

# vim: fileencoding=utf-8


def main():
    s = input()
    p = 700
    if s[0] == "o":
        p += 100
    if s[1] == "o":
        p += 100
    if s[2] == "o":
        p += 100
    print(p)


if __name__ == "__main__":
    main()