peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
S = input()

s = set([c for c in S])

x = 'abcdefghijklmnopqrstuvwxyz'

for a in s:
    x = x.replace(a, '')
if len(x) == 0:
    print('None')
else:
    print(x[0])
# Judge status: Accepted
K = int(input())
A,B = map(int,input().split())

flag = 0
for i in range(A,B+1):
    if i % K == 0:
        flag = 1
        break
if flag == 1:
    print("OK")
else:
    print("NG")
# Judge status: Accepted
W, H, x, y = map(int, input().split())
area = W*H/2

if x == W/2 and y == H/2:
    print(area, 1)
else:
    print(area, 0)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
sa = a[:]
for i in range(N-1):
  sa[i+1] += sa[i]

diff = float('inf')
for i in range(N-1):
  if abs(sa[i] - (sa[-1] - sa[i])) < diff:
    diff = abs(sa[i] - (sa[-1] - sa[i]))

print(diff)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
ab = abs(a-b)
if ab <= c:
  print(0)
else:
  print(ab-c)
# Judge status: Wrong Answer
C11, C12, C13 = map(int, input().split());
C21, C22, C23 = map(int, input().split());
C31, C32, C33 = map(int, input().split());

# a1 = 0と仮定して他を調整する
b1 = C11;
b2 = C12;
b3 = C13;

a2 = C21 - b1;
a3 = C31 - b1;

if (a2 >= 0 and
    a2 <= 100 and
    C22 == a2 + b2 and
    C23 == a2 + b3 and
    a3 >= 0 and
    a3 <= 100 and
    C32 == a3 + b2 and
    C33 == a3 + b3):
  print("Yes");
else:
  print("No");
# Judge status: Accepted
n = int(input())
a = sorted(map(int, input().split()))
ans = 0
for i in range(n, 3 * n, 2):
    ans += a[i]
print(ans)
# Judge status: Wrong Answer
A, B, K = map(int, input().split())
if A + B <= K * 2:
    for i in range(A, B + 1):
        print(i)
else:
    for i in range(A, A + K):
        print(i)

    for i in range(B - K + 1, B + 1):
        print(i)
# Judge status: Accepted
import sys
L, R , d = map(int, input().split())
ans = 0
for i in range(L,R + 1):
  if R < d:
    break
  if ( i % d ) == 0:
    ans += 1
print(ans)
# Judge status: Accepted
A,B,C=map(int,input().split())
a=A-B
b=C-a
if b<=0:
    print(0)
else:
    print(b)
# Judge status: Accepted
n, m = map(int, input().split())

ab = [list(map(int, input().split())) for _ in range(n)]
sorted_ab = sorted(ab, key=lambda x: x[0])

i,ans,cnt = 0,0,0

while cnt < m:
    ans += sorted_ab[i][0]*min(m-cnt,sorted_ab[i][1])
    cnt += min(m-cnt,sorted_ab[i][1])
    i+=1
print(ans)
# Judge status: Accepted
from itertools import accumulate
from bisect import bisect

n, m, k = map(int, input().split())
(*a,) = accumulate(map(int, input().split()))
(*b,) = accumulate(map(int, input().split()))
a = (0,) + tuple(i for i in a if i <= k)
b = tuple(i for i in b if i <= k)
print(max(i + bisect(b, k - a[i]) for i in range(len(a))))
# Judge status: Wrong Answer
import bisect
N=int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort()
C.sort()
d=0
for i in B:
 d+=bisect.bisect_right(A,i+0.1)*(N-bisect.bisect_left(C,i-0.1))
print(d)
# Judge status: Wrong Answer
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
from collections import Counter
#======================================================#
def main():
    n = II()
    s = IS()
    cnt_b = 0
    cnt_w = s.count('.')
    cnt = 2*10**5
    for si in s:
        if si == '#':
            cnt_b += 1
        else:
            cnt_w -= 1
        cnt = min(cnt, cnt_b+cnt_w)
    print(cnt)

if __name__ == '__main__':
    main()
# Judge status: Accepted
h, a = list(map(int, input().split()))
print((h+a-1)//a)
# Judge status: Accepted
S = input()
pred = ""
if S == "Sunny":
  pred = "Cloudy"
elif S == "Cloudy":
  pred = "Rainy"
elif S == "Rainy":
  pred = "Sunny"

print(pred)
# Judge status: Accepted
a=list(map(int,input().split()))
print(-(-sum(a)//2))
# Judge status: Wrong Answer
import sys, re
input = sys.stdin.readline

S = input()

if S == 'keyence' or re.fullmatch(r'[a-z]+keyence', S) or re.match(r'k[a-z]+eyence', S) or re.match(r'ke[a-z]+yence', S) or re.match(r'key[a-z]+ence', S) or re.match(r'keye[a-z]+nce', S) or re.match(r'keyen[a-z]+ce', S) or re.match(r'keyenc[a-z]+e', S) or re.fullmatch(r'keyence[a-z]+', S):
  print('YES')
else:
  print('NO')
# Judge status: Accepted
from collections import Counter
s = input()
ans = [False if i%2 else True for i in Counter(s).values()]
print("Yes" if all(ans) else "No")
# Judge status: Accepted
A, B, C = map(int, input().split())

count=0
for i in range(101):
    if A*(i+1)%B==C:
        print("YES")
        break
    else:
        count=count+1
if count==101:
    print("NO")
# Judge status: Wrong Answer
import fractions
from functools import reduce
import itertools
k = int(input()) 
l = list(range(1, k + 1))
ans = 0
for v in itertools.product(l, repeat=3):
    ans += min(list(v))
print(ans)
# Judge status: Accepted
a = list(map(int, input().split()))
a.sort()

if a[0]+a[1] == a[2]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a, b = map(int,input().split())
print(a-1 if a>b else a)
# Judge status: Accepted
#python3
def main():
    n, m = map(int, input().split())
    a = [int(i) for i in input().split()]
    s = sum(a)
    x = s/(4*m)
    c = 0
    for i in range(n):
        if x > a[i]:
            c += 1
    
    k = n-c
    if k >= m:
        print('Yes')
    else:
        print('No')
main()
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n,q = map(int, input().split())
s = input().rstrip()
lr = [list(map(int, input().split())) for _ in range(q)]

cnt = [0] * (n)
for i in range(0, n - 1):
    if s[i] == 'A' or s[i + 1] == 'C':
        cnt[i + 1] = cnt[i] + 1
    else:
        cnt[i + 1] = cnt[i]

for i in range(q):
    ll = lr[i][0] - 1
    rr = lr[i][1] - 1
    print(cnt[rr] - cnt[ll])
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
A = sorted(A,reverse = True)
A.insert(N,0)
print(A)
ans = 0
for i in range(0,N,2):
	ans += (A[i] - A[i+1])
	print(A[i],A[i+1])
print(ans)
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))

f = True
H[0] -= 1
for i in range(1, N):
  if H[i - 1] > H[i]:
    f = False
    break
  elif H[i - 1] < H[i]:
    H[i] -= 1

print("Yes" if f else "No")
# Judge status: Accepted
h1,m1,h2,m2,k = map(int,input().split())

time = (h2 - h1) * 60 + (m2 - m1)
print(time - k)
# Judge status: Wrong Answer
import math
n,k,s=[int(i) for i in input().split()]
ans=""
a=str(s//2)
b=str(math.ceil(s/2))
for i in range(n):
    if i==0:
        ans+=a
    elif i==1:
        ans+=b
    elif i>k:
        if(s==10**9):
            ans+=str(10**9-1)
        else:
            ans+=str(10**9)
    elif i%2==0:
        ans+=a
    elif i%2==1:
        ans+=b
    ans+=" "
print(ans[:-1])
# Judge status: Wrong Answer
import math
N,M=map(int,input().split())
p=10**9 +7
ans=(math.factorial(N)+math.factorial(M))*2 % p
print(ans)
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))

l = sorted(l)

count = 0
for i in range(2, n):
    for j in range(1, i):
        for k in range(j):
            if l[j] + l[k] > l[i] and l[i] != l[j] != l[k]:
                count += 1

print(count)
# Judge status: Accepted
S = input()
Q = int(input())
arr1 = []
arr2 = []
count = 1
for _ in range(Q):
    q = input()
    if q == "1":
        count *= -1
    else:
        _, f, c = map(str, q.split())
        if f == "1":
            arr1.append(c) if count == 1 else arr2.append(c)
        else:
            arr2.append(c) if count == 1 else arr1.append(c)

if count == 1:
    ans = "".join(arr1[::-1]) + S + "".join(arr2)
else:
    ans = "".join(arr2[::-1]) + S[::-1] + "".join(arr1)
print(ans)
# Judge status: Accepted
import bisect
N = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))

ans = 0
for i in range(N):
    l = bisect.bisect_left(A, B[i])
    r = N - bisect.bisect_right(C, B[i])
    ans += l * r

print(ans)
# Judge status: Accepted
from fractions import gcd
N, M = map(int, input().split())
a = list(map(int, input().split()))
k = a[0]
for i in range(1, N):
    k = (a[i]*k) // gcd(a[i], k)
    if k > M*2:
        print(0)
        exit(0)
    k = int(k)
ans = (M - (k // 2)) // k

if M >= (k // 2):
    flag = True
    for i in range(N):
        if (k // a[i]) % 2 == 0:
            print(0)
            exit(0)
    if flag:
        ans += 1

print(int(ans))
# Judge status: Accepted
a,b = map(int,input().split())
if a % b == 0:
  print(0)
else:
  print(1)
# Judge status: Accepted
a1, a2, a3 = map(int, input().split())
A = a1 + a2 + a3
if A >= 22:
    print("bust")
else:
    print("win")
# Judge status: Accepted
import numpy as np

n = int(input())
t, a = map(int, input().split())
h = np.array(list(map(int, input().split())))

A = list(map(lambda x: abs(a-(t-x*0.006)), h))
[idx] = [i for i, x in enumerate(A) if x == min(A)]

print(idx+1)
# Judge status: Wrong Answer
A = int(input())
B = int(input())

if A == 1 and B == 2:
    print('3')

elif A == 2 and B == 3:
    print('1')

else:
    print('2')
# Judge status: Accepted
(W,a,b) = map(int,input().split())
if a+W<b:
    print(b-(a+W))
elif b+W<a:
    print(a-(b+W))
else:
    print(0)
# Judge status: Accepted
A,B,C = map(int,input().split())
K = int(input())

c = 0

while A >= B:
    B *= 2
    c += 1

while B >= C:
    C *= 2
    c += 1

if c <= K:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
r = int(input())
print(r*2*3.14159265)
# Judge status: Wrong Answer
N = int(input())
S = input()
M = 10**9 + 7
cash = set()
from collections import Counter

cs = Counter(S)
ans = 1
for key, val in cs.items():
    ans *= (val + 1) %M
ans -= 1
print(ans)
# Judge status: Accepted
s_1 = input()
s_2 = input()
ans = "YES"
if s_1[0] != s_2[2] or s_1[1] != s_2[1] or s_1[2] != s_2[0]:
    ans = "NO"

print(ans)
# Judge status: Accepted
node_num, l_connected_node, g_connected_node = [int(n) for n in input().rstrip().split()]

l_connected_node-=1
g_connected_node-=1

count=[0]*node_num

for i in range(node_num-1):
    for j in range(i+1, node_num):
        count[min(j-i, abs(i-l_connected_node)+abs(j-g_connected_node)+1)]+=1

for x in range(1, node_num):
    print(count[x])
# Judge status: Wrong Answer
import sys

lines = sys.stdin.readlines()
K = int(lines[0])
X = lines[1].split(' ')
print(X)
A = X[0]
B = X[1]

n = int(int(A)/int(K))
m = int(int(B)/int(K))

if m-n >0:
    print('OK')
else:
    print('NG')
# Judge status: Accepted
x = int(input())
n = 1
while (x*n)%360!=0:
    n+=1
print(n)
# Judge status: Wrong Answer
N=int(input())
five=5
two=2
F=0
T=0
if N%2==1:
    print(0)
else:
    N = int(N/2)
    T += N
    while five < N:
        F += int(N//five)
        five *= 5
        
    print(int(F))
# Judge status: Accepted
# 絶対値はabs関数

a,b,c,d=map(int,input().split())

if abs(a-b)<=d and abs(b-c)<=d or abs(a-c)<=d:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n=int(input())

maxketa = n//100

if n <= maxketa*100+5*maxketa:
    print(1)
else:
    print(0)
# Judge status: Accepted
import math

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

ans = 0

print(math.ceil((N-1)/(K-1)))
# Judge status: Accepted
S = input()
count = 0
for i in range(3):
    if S[i] == '1':
        count += 1
print(count)
# Judge status: Accepted
h =int(input())

count =0 
while(h>0):
    h = int(h/2)
    count+=1
ans=0
for i in range(count):
    ans += 2**i
print(ans)
# Judge status: Accepted
#
import sys
import math
import numpy as np
import itertools

p=input()

if p=='AAA' or p == 'BBB':
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
def main():
    ABC = list(map(int,input().split()))
    tmp = [0,0,0]
    cube = ABC[0]*ABC[1]*ABC[2]
    for i in range(3):
        base = cube/ABC[i]
        tmp[i] = abs((ABC[i]//2*base)-((ABC[i]-ABC[i]//2)*base))
    print(int(min(tmp)))

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))

for i in range(n-1):
  if a[i] < 0:
    if a[i] + a[i+1] <= 0:
      a[i],a[i+1] = (-1)*a[i],(-1)*a[i+1]
      
print(sum(a))
# Judge status: Accepted
A =int(input())
def Primenumber(i):
    if i == 2:
        return 2
    for j in range(2,(i//2)+1):
        if i % j == 0:
            return Primenumber(i+1)
        elif j == i//2:
            return i
            
print(Primenumber(A))
# Judge status: Accepted
#ABC088

m = int(input())
a = sorted(list(map(int,input().split())),reverse=True)
p = 0
q = 0
for i in range(len(a)//2):
    p += a[2 * i]
    q += a[2 * i + 1]

if len(a) % 2 != 0:
    p += a[-1]

print(p-q)
# Judge status: Accepted
## coding: UTF-8
N = int(input())
D = [list(map(int, input().split())) for _ in range(N)]

#print(N, D)

ans = "No"
renzoku = 0

for i in range(N):
    if(D[i][0] == D[i][1]):
        renzoku += 1
        if(renzoku >= 3):
            ans = "Yes"
    else:
        renzoku = 0

print(ans)
# Judge status: Accepted
a, b, c, d = list(map(int,input().split()))
print(max(a * c, a * d, b * c, b * d))
# Judge status: Accepted
N = int(input())
V = sorted([float(v) for v in input().split()])

while len(V) > 1:
    if len(V) > 2:
        pick = V[0:2]
        V = [sum(pick)/2] + V[2:]
    else:
        V = [sum(V)/2]

print(V[0])
# Judge status: Wrong Answer
n = int(input())
l = list(map(int, input().split()))
print("Yes" if max(l) < sum(l) else "No")
# Judge status: Accepted
from collections import Counter
n=int(input())
a=Counter(input().split())
ans=0
for i,j in a.items():
  i=int(i)
  if i>j:
    ans+=j
  elif i<j:
    ans+=j-i
print(ans)
# Judge status: Accepted
n = int(input())
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
print(num2alpha(n).lower())
# Judge status: Accepted
N, M = map(int, input().split())
H_list = list(map(int, input().split()))
N_list = [0] * N
for _ in range(M):
  A, B = map(int, input().split())
  if H_list[A-1] >= H_list[B-1]:
    N_list[B-1] = 1
  if H_list[A-1] <= H_list[B-1]:
    N_list[A-1] = 1
print(N_list.count(0))
# Judge status: Accepted
H, N = map(int, input().split())
A = map(int, input().split())
print("Yes" if sum(A) >= H else "No")
# Judge status: Accepted
a,b = map(int, input().split())

s = list(input())

if len(s) != a+b+1:
  print("No")
else:
  for i in range(a):
    if s[i] == "-":
      print("No")
      exit()
  if s[a] != "-":
    print("No")
    exit()
  for j in range(a+1,a+b+1):
    if s[j] == "-":
      print("No")
      exit()
print("Yes")
# Judge status: Accepted
A=[int(s) for s in input().split()]

print("bust" if sum(A)>=22 else "win")
# Judge status: Wrong Answer
X,N = map(int,input().split())
p = list(map(int,input().split()))
if N == 0:
    print(X)
else:
    count = 0
    ans = 0
    while True:
        count +=1
        if X-count not in p:
            ans = X-count
            break
        elif X+count not in p:
            ans = X+count
            break
    print(ans)
# Judge status: Accepted
# ABC065c
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n, m = map(int, input().split())
MOD = 10**9+7

if not (n == m or n == m-1 or n == m+1):
    print(0)
    exit(0)


if n == m:
    print(math.factorial(n) % MOD * math.factorial(n) % MOD * 2 % MOD)
    exit(0)
print(math.factorial(n) % MOD*math.factorial(m) % MOD)
# Judge status: Accepted
f=lambda:map(int,input().split())
_,x=f()
m=[abs(i-x) for i in f()]
from fractions import *
a=m.pop()
for i in m: a=gcd(a,i)
print(a)
# Judge status: Accepted
from collections import Counter

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

c = Counter(A)
pair = []
# print(c)
for x, cnt in c.items():
    pair += [x] * (cnt//2)

# print(pair)
pair.sort()

ans = 0
if len(pair) >= 2:
    ans = pair[-1] * pair[-2]
print(ans)
# Judge status: Wrong Answer
x=input("alphabet:")
print(chr(ord(x)+1))
# Judge status: Accepted
# /usr/bin/env python3
# https://atcoder.jp/contests/abc042/tasks/arc058_a

n, k = input().split()
d = input().split()
while True:
    if len(set(n) & set(d)) == 0:
        print(n)
        break
    n = str(int(n) + 1)
# Judge status: Accepted
X, Y = map(int,input().split())

turu=X
kame=0
Flag=False
while turu>=0:
  total=4*turu+2*kame
  if total==Y:
    Flag=True
    break
  else:
    turu+=-1
    kame+=1
print("Yes" if Flag is True else "No")
# Judge status: Accepted
def main():
    N, Y = map(int, input().split())

    for i in range(0, N+1):
        for j in range(0, N+1):
            if N-i-j < 0:
                continue
            if i * 10000 + j * 5000 + (N-i-j) * 1000 == Y:
                print(i, j, (N-i-j))
                return 
    print(-1, -1, -1)

main()
# Judge status: Accepted
N,M = map(int,input().split())
MOD = 10**9+7
dp = [0] * (N+1)
dp[1] = 1
for _ in range(M):
  dp[int(input())] = -1
if N<2:
  print(dp[N])
  exit()

if dp[2] != -1:
  dp[2] = 1
for i in range(N+1):
  if dp[i] == -1: continue
  if i-1>=0 and dp[i-1] != -1:
    dp[i] += dp[i-1]
  if i-2>=0 and dp[i-2] != -1:
    dp[i] += dp[i-2]
  dp[i] %= MOD

print(dp[N])
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

sum = 0
for i in range(N)[1:]:
  if A[i-1]>A[i]:
    sum += A[i-1]-A[i]
    A[i] = A[i-1]
    
print(sum)
# Judge status: Accepted
def c2a(c):
    return (26 - ord(c) + ord("a")) % 26


s = input()
k = int(input())
l = len(s)
ans = ""
for i, e in enumerate(s, 1):
    if i == l:
        code = (ord(e) - ord("a") + k) % 26 + ord("a")
        c = chr(code)
    else:
        cnt = c2a(e)
        if cnt <= k:
            c = "a"
            k -= cnt
        else:
            c = e

    ans += c

print(ans)
# Judge status: Accepted
n, m = map(int, input().split())

if m >= n:
    print('unsafe')

else:
    print('safe')
# Judge status: Accepted
import math

#n, a, b= map(int, input().split())
a, b  = map(int, input().split())
#h = list(map(int, input().split()))
#s = list(str(input()))
#n = int(input())

tot = 0
count = 0

for i in range(a, b+1):
  n_str = list(str(i))
  integ  = [int(s) for s in n_str]
  integ_rev = integ[::-1]
  if (integ == integ_rev):
    count = count + 1

print(count)
# Judge status: Accepted
import sys


n = int(input())

a_list = list(map(int, input().split()))

for a in a_list:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            print('DENIED')
            sys.exit(0)

print('APPROVED')
# Judge status: Accepted
W, H, x, y = map(int,input().split())
cg = [W/2, H/2]
if [x, y] == cg:
    print( W * H / 2, 1)
else:
    print(W * H / 2, 0)
# Judge status: Accepted
N = int(input())
xy = []
for i in range(N):
    xy.append(list(map(int, input().split())))


def f(x, y):
    return [x - y, x + y]


XY = []
for x, y in xy:
    XY.append(f(x, y))

large, small = [-float('inf'), -float('inf')], [float('inf'), float('inf')]
for i in range(2):
    for j in XY:
        large[i] = max(j[i], large[i])
        small[i] = min(j[i], small[i])

ans = max(large[0] - small[0], large[1] - small[1])
print(ans)
# Judge status: Wrong Answer
M = 10**9 + 7


def main():
    n = int(input())
    a = 1
    b = 1
    c = 1
    for i in range(n):
        a *= 10
        a %= M
        b *= 9
        b %= M
        c *= 8
        c %= M
    print(a - b - b + c)


if __name__ == '__main__':
    main()
# Judge status: Accepted
a, s, c = input().split()
print('A'+s[0]+'C')
# Judge status: Accepted
n = int(input())
sp = [[input().split(), i+1] for i in range(n)]
sp = sorted(sp, key=lambda x:(x[0][0], -int(x[0][1])))
for i in range(n):
    print(sp[i][1])
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))

a = sorted(a, reverse=True)
maxScoreArray = []
for i in range(N):
  maxScoreArray.append(a[i*2+1])

print(sum(maxScoreArray))
# Judge status: Accepted
A = [i for i in range(2, 14)] + [1]
a, b = map(int, input().split())
c = -1
d = -1
for i in range(len(A)):
    if c == -1 and A[i] == a:
        c = i
    if d == -1 and A[i] == b:
        d = i

if c > d:
    print("Alice")
elif c < d:
    print("Bob")
else:
    print("Draw")
# Judge status: Accepted
n,x=map(int,input().split())
l=list(map(int,input().split()))
D=0
y=1
if x==0:
    print(1)
else:
    for i in range(n):
        D+=l[i]
        if D<=x:
            y+=1
    print(y)
# Judge status: Accepted
a, b = map(int, input().split())
if a > b:
  r = a - 1
else:
  r = a

print(int(r))
# Judge status: Accepted
N = list(map(int, input()))

m = 0 # 最小の枚数
m_ = 1 # 繰り上がり時の枚数

for n in N:
  m, m_ = min(m+n, m_ + 10-n), min(m+n + 1, m_ + 10-(n+1))
print(m)
# Judge status: Accepted
s = input()
if s.isupper():
  print('A')
else:
  print('a')
# Judge status: Accepted
def main():
    N = int(input())
    l = [int(x) for x in input().split()]
    l.sort()
    total = 0
    for i in range(N-1):
        total = total + l[i]
    if total > l[N-1]:
        print('Yes')
    else:
        print('No')
main()
# Judge status: Wrong Answer
x,a,b = map(int,input().split())

print("A" if abs(x-a)>abs(x-b) else "B")
# Judge status: Accepted
n = int(input())
print((n+1)//2/n)
# Judge status: Accepted
A=int(input())
B=int(input())
ans=[1,2,3]
for a in ans:
    if a!=A and a!=B:
        print(a)
# Judge status: Accepted
x = int(input())

ans = (x//11)*2
p = x % 11
if p == 0:
    print(ans)
elif 1 <= p <= 6:
    print(ans+1)
elif 7<= p:
    print(ans+2)
# Judge status: Accepted
import sys
#import time
#from collections import deque, Counter, defaultdict
#from fractions import gcd
import bisect
#import heapq
#import math
import itertools
import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))


n = ri()
a = rl()
a=a+a
a.sort()

a.pop()
ans=0
for i in range(n-1):
    ans+=a[-i-1]
print(ans)
# Judge status: Accepted
n, m = list(map(int, input().split()))

a = 1
b = n

if n%2==1:
    for i in range(m):
        print(a, b)
        a += 1
        b -= 1
else:
    pair = 0
    while b-a > n//2 and pair < m:
        print(a, b)
        pair += 1
        a += 1
        b -= 1
    a += 1
    while pair < m:
        print(a, b)
        pair += 1
        a += 1
        b -= 1
# Judge status: Accepted
#create date: 2020-07-05 10:44

import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    a, b = na()
    if a > b:
        a, b = b, a
    if (b - a) % 2 != 0:
        print("IMPOSSIBLE")
        quit()
    else:
        print(a + (b-a)//2)
if __name__ == "__main__":
    main()
# Judge status: Accepted
s = input()
n = len(s)
for i in range(2**(n-1)):
    op = ["-"] * (n-1)
    for j in range(n-1):
        if (i >> j) & 1:
            op[n - 2 -j] = "+"
    #print(op)
    chk = ""
    for p_n, p_o in zip(s, op + [""]):
        chk += (p_n + p_o)
    if eval(chk) == 7:
        print(chk + "=7")
        exit()
# Judge status: Accepted
x = int(input())

div, mod = divmod(x, 11)
div *= 2

if mod > 0 and mod < 7:
    div += 1
elif mod > 6:
    div += 2

print(div)
# Judge status: Wrong Answer
# AtCoder
N = int(input())
l = [list(map(int, input().split())) for i in range(N)]

m = sorted(l, key=lambda x: x[0])
work = 0
mx = -100
for i in range(N):
    work += m[i][0]
    mx = max(m[i][1], mx)

if mx >= work:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n,k=map(int,input().split())
l=list(map(int,input().split()))
i=l.index(1)
k-=1
print(-(-i//k)-((-(n-i-1))//k))
# Judge status: Accepted
import collections
n = int(input())
a = list(map(int, input().split()))

c = dict(collections.Counter(a))

sum = 0
for v in c.values():
    sum += (v * (v - 1)) // 2

for i in a:
    temp = c[i] - 1
    ans = (temp * (temp - 1)) // 2
    ans += sum
    ans -= (c[i] * (c[i] - 1)) // 2
    print(ans)
# Judge status: Wrong Answer
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
import math
from functools import reduce

n = int(readline())
a = list(map(int,readline().split()))

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

x = reduce(lcm, a, 1)

ans = 0
for i in a:
    ans += x // i

print(ans%100000007)