peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
import fileinput

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

print(sum(a))

if h <= sum(a):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
k,n=map(int,input().split())
a=list(map(int,input().split()))
a=a+[k+a[0]]
b=[a[i+1]-a[i] for i in range(n)]
m=max(b)
print(k-m)
# Judge status: Accepted
n = int(input())
start_end = [[0] * 10 for _ in range(10)]
for i in range(1,n+1):
    start = int(str(i)[0])
    end = int(str(i)[-1])
    start_end[start][end] += 1
ans = 0
for start in range(10):
    for end in range(start,10):
        if start == end:
            ans += start_end[start][end]**2
        else:
            ans += start_end[start][end] * start_end[end][start] * 2
print(ans)
# Judge status: Accepted
N=int(input())
print(N*(N+1)//2)
# Judge status: Accepted
n = int(input())
a = [int(i) for i in input().split()]

len_f = sum(a)
sum_a = 0
min = 2020202021

for i in range(n):
    sum_a += a[i]
    len_f -= a[i]
    if min > abs(sum_a - len_f):
        min = abs(sum_a - len_f)

print(min)
# Judge status: Accepted
# ABC065_B
N = int(input())
A = [int(input()) for _ in range(N)]

now = 0
cnt = 0
while now != 1:
    now = A[now] - 1
    cnt += 1
    if cnt > N:
        cnt = -1
        break
print(cnt)
# Judge status: Accepted
# input
numbers = list(map(int, input().split()))
K = int(input())

# check
for c in range(K):
    max_num = max(numbers)
    max_idx = numbers.index(max_num)
    numbers[max_idx] *= 2

print(sum(numbers))
# Judge status: Accepted
a=input()
n=int(a[len(a)-1])
l=[2,4,5,7,9]
if n in l:
    print("hon")
elif n != 3:
    print("pon")
else:
    print("bon")
# Judge status: Wrong Answer
n = input()
a = list(map(int, input().split()))
ans = float('inf')
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind('1') - 1)
# Judge status: Accepted
import sys

N = int(input())
A = list(map(int, sys.stdin.readline().rsplit()))

res = 0
for i, a in enumerate(A):
    if (i + 1) % 2 == 1 and a % 2 == 1:
        res += 1
print(res)
# Judge status: Wrong Answer
a,b,m=map(int,input().split())
ai=list(map(int, input().split()))
bi=list(map(int, input().split()))
sm=[list(map(int, input().split())) for _ in range(m)]
k=min(ai)+min(bi)
for x in range(m):
    l=ai[sm[x][0]-1]+bi[sm[x][1]-1]-sm[x][2]
    ans=min(k,l)

print(ans)
# Judge status: Accepted
A = [int(input()) for _ in range(5)]
k = int(input())
if max(A) - min(A) <= k:
  print('Yay!')
else:
  print(':(')
# Judge status: Wrong Answer
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a.sort()
jud = 0
q = a[0]
ans = 0
for i in range(n):
  if(q==a[i]):
    jud += 1
  else: 
    if(jud%2==1):
      ans += 1
    jud = 1
if (jud%2==1):
  ans += 1
print(ans)
# Judge status: Accepted
if __name__ == "__main__":
    a, b = input().split()

    n = int(a+b)

    for i in range(317):
        if i*i == n:
            print('Yes')
            exit()

    print('No')
# Judge status: Accepted
n, a, b, c, d = map(int, input().split())
s = input()

ans = 'Yes'
if s[a:c].find('##') > -1:
    ans = 'No'
elif s[b:d].find('##') > -1:
    ans = 'No'
else:
    if d < c:
        if s[b-2:d+1].find('...') == -1:
            ans = 'No'

print(ans)
# Judge status: Wrong Answer
import math as M
k = int(input())
a, b = map(int, input().split())

a_1 = M.floor(a % k)
b_1 =  M.floor(b % k)

if a % k == 0 :
    print('OK')
elif b_1 - a_1 > 1 :
    print('NG')
else :
    print('OK')
# Judge status: Accepted
n=input()
keta=[0,0]
for i in range(len(n)):
	keta.append(int(n[i]))
ans=0
for i in range(len(keta)-1):
	if keta[-i-2]>=5:
		if keta[-i-1]>=5:
			ans+=10-keta[-i-1]
			keta[-i-2]+=1
		else:
			ans+=keta[-i-1]
	else:
		if keta[-i-1]>=6:
			ans+=10-keta[-i-1]
			keta[-i-2]+=1
		else:
			ans+=keta[-i-1]
print(ans)
# Judge status: Wrong Answer
X,Y,Z = map(int, input().split())
print(X,Y,Z)
# Judge status: Accepted
import sys
n=int(input())
h=list(map(int,input().split()))
if n==2:
  print(abs(h[1]-h[0]))
  sys.exit()
c=[float('inf')]*n
c[0]=0
c[1]=abs(h[1]-h[0])
for i in range(n-2):
  c[i+2]=min(c[i]+abs(h[i+2]-h[i]),c[i+1]+abs(h[i+2]-h[i+1]))
print(c[n-1])
# Judge status: Accepted
n,m = map(int,input().split())
dp = [-1]*(n+1) 
dp[0] = 1
mod = 10**9 + 7
for i in range(m):
    a = int(input())
    dp[a-1] = 0
#print(dp)
for i in range(1,n+1):
    if dp[i] == 0:
        continue
    else:
        if i == 1:
            dp[i] = dp[i-1] +1
        else:
            dp[i] = (dp[i-1] + dp[i-2])%mod
        #print(dp)
print(dp[n-1])
# Judge status: Accepted
n = int(input())
res = [['a'],[],[],[],[],[],[],[],[],[]]
cha = ['a','b','c','d','e','f','g','h','i','j']

for x in range(1,n):
  for y in res[x-1]:
    for c in range(10):
      if cha[c] not in y:
        for d in range(c+1):
          res[x].append(y+cha[d])
        break
  if x > n + 1:
    break

for ans in range(len(res[n-1])):
  print(res[n-1][ans])
# Judge status: Accepted
k,n = map(int, input().split())
a = list(map(int, input().split()))

mx = k-a[-1] +a[0]

for i in range(n-1):
    dist = a[i+1] - a[i]
    mx = max(mx,dist)
print(k-mx)
# Judge status: Accepted
x = int(input())
if 360 % x == 0:
    print(360//x)
else:
    for i in range(1,10000):
        if 360 * i % x == 0:
            print(360 * i // x)
            exit()
# Judge status: Accepted
N = int(input())
W = [input() for _ in range(N)]
b = len(set(W))==len(W) and all(map(lambda s,t:s==t, (s[-1] for s in W[:-1]) ,(s[0] for s in W[1:])))
print("YNeos"[not b::2])
# Judge status: Wrong Answer
n, k = map(int, input().split())
print(n // k + 1)
# Judge status: Accepted
N,*I=[int(input()) for _ in range(6)]
mn=min(I)
print(5+(N+mn-1)//mn-1)
# Judge status: Wrong Answer
R,G,B=map(int,input().split())
K=int(input())
#print(R,G,B,K)

for i in range(K):
  if(B<=G):
    B*=2
  if(G<=R):
    G*=2
#print(R,G,B,K)
if(R<G and G<B):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())
Ds = list(map(int, input().split()))

Ds.sort()

D1, D2 = Ds[N//2-1], Ds[N//2]

print(D2-D1)
# Judge status: Accepted
from collections import Counter

n = int(input())
lst = list(map(int,input().split()))
c = Counter(lst)
res = 0
for k,v in c.items():
    if v >= 2:
        res += v*(v-1)//2
for x in lst:
    if c[x]<2:
        print(res)
    else:
        print(res - (c[x] - 1))
# Judge status: Accepted
input_line=input()
if input_line.count("5")==2 and input_line.count("7")==1:
    print ("YES")
else:
    print ("NO")
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))

cost = [0] * N
for i in range(1, N):
  d1 = cost[i-1] + abs(H[i] - H[i-1])
  d2 = cost[i-2] + abs(H[i] - H[i-2]) if i > 1 else 1e6
  cost[i] = min(d1, d2)
#print(cost)
ans = cost[N-1]
print(ans)
# Judge status: Accepted
N,M=map(int,input().split())
l=[0]*M
for i in range(N):
    KA=list(map(int,input().split()))
    for j in range(KA[0]):
        l[KA[j+1]-1]+=1
#print(l)
ans=l.count(N)
print(ans)
# Judge status: Wrong Answer
n=int(input())
cnt=0
for a in range(1,n):
    for b in range(1,n):
        if a*b <=n-1:
            cnt+=1
            print(a,b,a*b)
        else:
            break
print(cnt)
# Judge status: Accepted
n , k , s = map(int,input().split())
l = []
for i in range(k):
    l.append(s)
if s == 1:
    t = 3
elif s == 10**9:
    t = 1
else:
    t = s + 1

for i in range(n-k):
    l.append(t)


print(' '.join(map(str, l)))
# Judge status: Accepted
N = int(input())
B = list(map(int,input().split()))
A = [B[0]]
for i in range(1,N-1):
  A.append(min(B[i],B[i-1]))
A.append(B[-1])
print(sum(A))
# Judge status: Wrong Answer
A,B,C,D = [int(_n) for _n in input().split()]
taka = C / B + (0 if C % B == 0 else 1)
aoki = A / D + (0 if A % D == 0 else 1)
print("Yes" if taka <= aoki else "No")
# Judge status: Accepted
n=int(input())
l=[]
for i in range(n):
    l.append(input())
    
x=set(l)
x=list(x)
c=0
if len(x)!=n:
    print('No')
else:
    for i in range(n-1):
        if l[i][-1]==l[i+1][0]:
            c+=1
    if c==n-1:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
n = input()

onaji = 0

flag = False

for i in range(3):
    if n[i] == n[i+1]:
        onaji += 1
        if onaji >= 2:
            flag = True
    else:
        onaji = 0
        
if flag == True:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a, b = map(int, input().split())
S = input().split('-')

if len(S) == 2 and len(S[0]) == a:
    print('yes')
else:
    print('no')
# Judge status: Accepted
n=int(input())
p=list(map(int,input().split()))
ans=0
for i in range(1,n-1):
  if (p[i-1]<=p[i] and p[i]<=p[i+1]) or (p[i+1]<=p[i] and p[i]<=p[i-1]):
    ans+=1
print(ans)
# Judge status: Wrong Answer
c = input()
data = []
for s in range(0,int(c)):
  data.append(list(map(int, input().split())) )

nexttime = 0
nextx = 0
nexty = 0


for s in range(0, len(data)):
  nexttime = data[s][0]
  nextx = data[s][1]
  nexty = data[s][2]
  if ( (nexttime < nextx+nexty) or ((((nextx + nexty) ) % 2) != (nexttime % 2) ) ):
    print("NO")
    exit()


print("YES")
# Judge status: Accepted
N,L = map(int,input().split())
wordlist = []
for i in range(N):
    x = input()
    wordlist.append(x)

answer = "".join(sorted(wordlist))
print(answer)
# Judge status: Accepted
N=int(input())
A=int(input())
check=N%500
print("Yes" if check<=A else "No")
# Judge status: Accepted
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
dic = Counter(A)
cnt = 1
Mcnt = 1
for i in range(0,N):
  if (i-1) in dic and (i+1) in dic:
      cnt = dic[i-1] + dic[i] + dic[i+1]
  elif (i-1) in dic:
      cnt = dic[i-1] + dic[i]
  elif (i+1) in dic:
      cnt = dic[i] + dic[i+1]
  else:
      cnt = dic[i]
  if Mcnt < cnt:
    Mcnt = cnt
print(Mcnt)
# Judge status: Accepted
a,b,c,d = map(int,input().split())
print('Yes' if abs(a-c) <= d or (abs(a-b) <= d and abs(b-c) <= d) else 'No')
# Judge status: Accepted
n,m=list(map(int,input().split(" ")))
a=[]
dp=[float("inf") for i in range(n+1)]
for i in range(m):
  a=int(input())
  dp[a]=0
dp[0]=1
if dp[1] != 0:
  dp[1]=1
for i in range(2,n+1):
  if dp[i]!=0:
    dp[i]=dp[i-1]+dp[i-2]
print(dp[n]%1000000007)
# Judge status: Accepted
import numpy as np
N, H = map(int,input().split())

maxA = 0
B = []
for _ in range(N):
    a, b = map(int,input().split())
    B.append(b)
    if maxA < a:
        maxA = a

B = np.array(B)
throw_all = np.sort((B[B>maxA]))[::-1]
SUM = 0
cnt = 0
for a in throw_all:
    SUM += a
    cnt += 1
    if SUM >= H:
        print(cnt)
        exit()

ans = -(-(H-SUM)//maxA)+ cnt
print(ans)
# Judge status: Accepted
n,x,t=map(int,input().split())

if n%x==0:
    print(t*(n//x))
else:
    print(t*(n//x+1))
# Judge status: Wrong Answer
s = str(input())
t = str(input())
sl = []
tl = []
alp = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(s)):
  for j in range(26):
    if(s[i]==alp[j]):
      sl.append(j)
for i in range(len(t)):
  for j in range(26):
    if(t[i]==alp[j]):
      tl.append(j)
tl.sort(reverse=True)
sl.sort()
j = 0
for i in range(min(len(sl),len(tl))):
  if(sl[i]>tl[i]):
    j += 1
if(j>0):
  print("No")
else:
  print("Yes")
# Judge status: Accepted
N,M = map(int,input().split())
H = list(map(int,input().split()))
A = [0]*M
B = [0]*M
for i in range(M):
    A[i],B[i] = map(int,input().split())
mountains = [0]*N
for i in range(M):
    if H[A[i]-1]>H[B[i]-1]:
        mountains[B[i]-1] -= 1
    elif H[A[i]-1]<H[B[i]-1]:
        mountains[A[i]-1] -= 1
    else:
        mountains[B[i]-1] -= 1
        mountains[A[i]-1] -= 1
print(mountains.count(0))
# Judge status: Accepted
K, X = map(int, input().split())
A = K - 1
B = range(X - A, X + K)
for b in B:
    print(b, end = " ")
# Judge status: Wrong Answer
N = int(input())
s = input()
t = input()
ans = s + t

for i in range(N):
    if(s[i:] == t[:(len(t)-i)]):
        ans = s + t[-i:]

print(ans if s != t else s)
# Judge status: Accepted
K, S = map(int, input().split())
count = 0
for X in range(K+1):
  for Y in range(K+1):
    if 0 <= S-X-Y <= K:
      count += 1
print(count)
# Judge status: Accepted
num = (int)(input())
count = 1
while((count + 1) * count / 2 < num):
  count += 1
print(count)
# Judge status: Accepted
X = int(input())

dp = [0] * (X + 105 + 1)
dp[0] = 1

for i in range(X):
    if dp[i] == 1:
        for c in [100, 101, 102, 103, 104, 105]:
            dp[i+c] = 1

print(dp[X])
# Judge status: Wrong Answer
s=input()[::-1]
n=len(s)
p=2019
ans=[0]*p

x10=1
S=0
for i in range(n):
  S=(S+(x10*int(s[i])))%p
  x10=(x10*10)%p
  ans[S]+=1

cnt=ans[0]
for i, a in enumerate(ans):
  if i:
  	cnt+=(a*(a-1))//2
  
print(cnt)
# Judge status: Accepted
A, B, C, K = map(int,input().split())
if K == 0 or K % 2 ==0:
  ans = A-B
else:
  ans = -(A-B)
if abs(ans) > 10**18:
  print("Unfair")
else:
  print(ans)
# Judge status: Accepted
a,b=map(str,input().split())
ans = int(a+b)
flag=True
for i in range(ans):
    tmp=i*i
    if tmp==ans:
        print("Yes")
        flag=False
        break
if flag:
    print("No")
# Judge status: Accepted
n = int(input())
for _ in range(n):
    t, x, y = map(int, input().split())
    if (x + y) > t or (x + y + t) % 2:
        print("No")
        exit()
print("Yes")
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
def main():
    listA = input();
    newlistA = sorted(listA);

    for i in range(len(newlistA)-1):
        if newlistA[i] == newlistA[i+1]:
            print('No');
            return 0;
        else:
            print('Yes');
            return 0;


main();
# Judge status: Accepted
a,b,c = map(int,input().split())
print("win" if a+b+c<22 else "bust")
# Judge status: Wrong Answer
a,b=input().split()
a=int(a)
c=""
for i in range(len(b)):
    if not b[i]==".":
        c+=b[i]
b=int(c)
ans=float(a*b+0.001)
ans=int(ans/100)
print(ans)
# Judge status: Accepted
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():  
    S = input()
    a = [0] * (len(S) + 1)
    for i in range(len(S)):
        if S[i] == '<':
            a[i + 1] = max(a[i + 1],a[i] + 1)
    for i in range(len(S) - 1,-1,-1):
        if S[i] == '>':
            a[i] = max(a[i],a[i + 1] + 1)
    print(sum(a))    
if __name__ == '__main__':
    main()
# Judge status: Accepted
import math


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    N = read_int()
    A = read_ints()
    avg = sum(A)/N
    cost = lambda M: sum(abs(a-M)**2 for a in A)
    return min(cost(math.floor(avg)), cost(math.ceil(avg)))


if __name__ == '__main__':
    print(solve())
# Judge status: Accepted
from collections import Counter

N = int(input())
s = list(input())
c = Counter(s)

for _ in range(N - 1):
    s = list(input())
    tmp = Counter(s)
    for k, v in c.items():
        if k not in tmp:
            c[k] = 0
        else:
            c[k] = min(tmp[k], v)

ans = ""
c = sorted(c.items(), key=lambda x: x[0])
for k, v in c:
    ans += k * v
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = [x for x in input().split()]

count = []
temp = a[0]
for i in range(1, len(a)):
    if a[i] == a[i-1]:
        temp += a[i]
    else:
        count.append(temp)
        temp = a[i]

count.append(temp)

for x in count:
    print(len(x))

rest = len(a) - len(count)
for x in range(rest+1):
    print(0)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))[::2]
c=0
for i in a:
  c+=(i%2)
print(c)
# Judge status: Wrong Answer
a, b = map(int, input().split())
if (a+b) % 2 == 0:
    print((a+b)/2)
else:
    print('IMPOSSIBLE')
# Judge status: Wrong Answer

n=int(input())
print(n%1000)
# Judge status: Wrong Answer
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

i = 0
l = len(A)
n = 1
lst = []

while True:
    lst.append(A[i])
    i = A[i] - 1
    n += 1
    if A[i] == 2:
        print(n)
        break

    if A[i] in lst:
        print(-1)
        break

    if n == l:
        print(-1)
        break
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1,n+1):
  if(len(str(i))%2):
    ans+=1
print(ans)
# Judge status: Accepted
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

base = min(a) + min(b)
answer = base

for i in range(M):
    x, y, c = map(int, input().split())
    price = a[x - 1] + b[y - 1] - c
    if answer > price:
        answer = price
print(answer)
# Judge status: Accepted
import statistics

N = int(input())
a = []
b = []
for i in range(N):
    A,B = map(int, input().split())
    a.append(A)
    b.append(B)

a2 = statistics.median(a)
b2 = statistics.median(b)

if N % 2 == 0:
    c = (b2-a2)/0.5 + 1
    print(int(c))
else:
    print(b2-a2+1)
# Judge status: Accepted
S = input()
a = S.count("a")
b = S.count("b")
c = S.count("c")

if max(a, b, c)-min(a, b, c) >= 2:
    print("NO")
else:
    print("YES")
# Judge status: Accepted
l = list(map(int, input().split()))

def attack(l):
    H = l[0]
    A = l[1]
    cnt = 0
    while H > 0:
        H -= A
        cnt += 1
    return cnt

print(attack(l))
# Judge status: Accepted
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
import collections

mod = 10 ** 9 + 7
a, b, x = list(map(int, input().split()))
if (a * a * b / 2 >= x):
    print(90. - np.rad2deg(np.arctan(2*x/(a*b*b))))
else:
    print(np.rad2deg(np.arctan(2*b/a - 2*x/(a**3))))
# Judge status: Wrong Answer
import itertools
N = int(input())
ary1  = map(int,input().split())
def f(n1,n2):
  bunsi = max([n1,n2])
  bunbo = min([n1,n2])
  amari = bunsi % bunbo
  if amari < (-amari+bunbo) % bunbo:
    return(amari)
  else:
    return(-amari+bunbo)

print(min([f(x[0],x[1]) for x in itertools.combinations(ary1,2) ]) )
# Judge status: Accepted
N, A, B = map(int, input().split())
if N == 1:
	if A == B: print(1)
	else: print(0)
	exit()
if A > B:
	print(0)
	exit()
min = A + B + ((N - 2) * A)
max = A + B + ((N - 2) * B)
print(max - min + 1)
# Judge status: Accepted
import sys
from collections import Counter

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = list(map(int, input().split()))
    B = []
    for a in A:
        B.append(a - 1)
        B.append(a)
        B.append(a + 1)
    D = Counter(B)
    res = max([v for v in D.values()])
    print(res)


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
from math import gcd
n = int(input())
t = [int(input()) for i in range(n)]
ans = 1
for i in range(n):
    ans = ans*t[i]//gcd(ans, t[i])
print(ans)
# Judge status: Accepted
S = list(input())
N = len(S)
# print(S)

if N % 2 == 0:
    div = int(N / 2)
else:
    div = int(N // 2)

# print(type(div),div)
S_pic = S[:div]
S_rev = list(reversed(S[div:]))

# print(S_pic)
# print(S_rev)

count = 0
for i in range(div):
    if S_pic[i] != S_rev[i]:
        count += 1

print(count)
# Judge status: Accepted
n = int(input())
ns = list(map(int, input().split()))
bs = list(map(int, input().split()))
count = 0
for i in range(n):
    monster = min(ns[i], bs[i])
    count += monster
    bs[i] -= monster
    monster2 = min(ns[i+1], bs[i])
    count += monster2
    ns[i+1] -= monster2
print(count)
# Judge status: Accepted
S = input()
ans = 'x' * len(S)
print(ans)
# Judge status: Accepted
from math import sqrt
n,d=map(int,input().split())
xs=[tuple(map(int,input().split())) for _ in range(n)]
ans=0
for i in range(n-1):
    xi=xs.pop()    
    for xj in xs:
        o=sqrt(sum((y-z)**2 for y,z in zip(xi,xj)))
        ans += o//1==o
print(ans)
# Judge status: Accepted
r,g,b=map(int,input().split())
if (10*g+1*b)%4==0:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer

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

B = [0] * N
if N % 2 == 0:
  for i in range(N):
    if i % 2 == 0:
      print(i, A[i], i//2, N//2+i//2)
      B[N//2+i//2] = A[i]
    else:
      print(i, A[i], i//2, N//2-(i//2+1))
      B[N//2-(i//2+1)] = A[i]
else:
  for i in range(N):
    if i % 2 == 1:
      B[N//2+(i//2+1)] = A[i]
    else:
      B[N//2-(i//2)] = A[i]

print(*B)
# Judge status: Accepted
n = int(input())
A, B, C = 0, 0, 0
for _ in range(n):
  a, b, c = map(int, input().split())
  A, B, C = a + max(B, C), b + max(C, A), c + max(A, B)
print(max(A, B, C))
# Judge status: Accepted
from collections import defaultdict

n = int(input())
dd = defaultdict(int)

for _ in range(n):
    dd[input()]+=1

maxnum = max(dd.values())

arr=[]

for k in dd:
    if dd[k]==maxnum:
        arr.append(k)

for a in sorted(arr):
    print(a)
# Judge status: Wrong Answer
N, K = map(int, input().split())
h = list(map(int, input().split()))
h = h + [0] * (K + 1)

# DPテーブル
dp = [10 ** 10] * (N + 1 + K)

# 初期値
dp[0] = 0
dp[1] = 0

# ループ
for i in range(1, N + 1):
    for j in range(1, K + 1):
        dp[i + j] = min(dp[i + j], dp[i] + abs(h[i + j] - h[i]))

# 解を出力
print(dp[N])
# Judge status: Accepted
t_h, t_a, a_h, a_a = [int(i) for i in input().split()]

turn = True
while True:
    if turn:
        a_h -= t_a
    else:
        t_h -= a_a

    turn = not turn

    if a_h <= 0:
        print('Yes')
        break
    if t_h <= 0:
        print('No')
        break
# Judge status: Accepted
input();a=list(map(int,input().split()))
b1,b2,b4=0,0,0
for i in a:
  if i%2!=0: b1+=1
  elif i%4==0: b4+=1
  else: b2+=1
print('Yes' if b1<=b4 else 'No' if b2 else 'Yes' if b1<=b4+1 else 'No')
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
dai=[0]*n
x=a[0]
for i in range(n-1):
    if a[i+1]-x<0:
        dai[i+1]=x-a[i+1]
        x=a[i+1]+dai[i+1]
    else:
        x=a[i+1]
print(sum(dai))
# Judge status: Accepted
station=input()

flg="No"
for i in range(2):
    if station[i]!=station[i+1]:
        flg="Yes"

print(flg)
# Judge status: Accepted
n = int(input())
A = [int(input()) for _ in range(n)]

import collections
c = collections.Counter(A)
ans = 0
for key in c.keys():
    if c[key]%2 == 1:
        ans +=1
print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
if c < a or c < b:
  print('No')
else:
  print('Yes' if (4 * a * b < (c - a - b) ** 2) else 'No')
# Judge status: Accepted
n, k = map(int, input().split())


def base_10_to_n(X, n):
    if (int(X/n)):
        return base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)

rslt = base_10_to_n(n, k)

print(len(rslt))
# Judge status: Wrong Answer
S = 'RRS'
p = 0
for i in range(len(S)):
    if S[i] != 'S':
        p =+ 1
    else:
      	p == 0
print(p)
# Judge status: Accepted
import numpy as np

d = int(input())

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

sd = np.zeros((d, 26), dtype=np.int)
for i in range(d):
  s = list(map(int, input().split()))
  s_array = np.array(s)
  sd[i, :] = s_array
  
for i in range(d):
  print(np.argmax(sd[i, :])+1)
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))
ans = 10**10
for i in range(n-k+1):
    tmp = min(abs(a[k+i-1] - a[i]) + abs(a[i]), abs(a[k+i-1] - a[i]) + abs(a[k+i-1]))
    if ans > tmp:
        ans = tmp
print(ans)
# Judge status: Accepted
n = int(input())
ab = [tuple(map(int, input().split())) for _ in range(n)]
a, b = map(list, zip(*ab))
a.sort()
b.sort(reverse=True)
a1, b1 = a[n//2], b[n//2]
a2, b2 = a[n//2-1], b[n//2-1]
if n % 2: print(b1 - a1 + 1)
else: print((b1+b2) - (a1+a2) + 1)
# Judge status: Accepted
s,t = input().split()
print(t + s)
# Judge status: Accepted
c_u=input()
c_d=input()
if c_u==c_d[::-1]:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
a, b = map(int, input().split())
amari = (a * b) % 2 
if amari == 0:
   print('Even')
else:
    print('Odd')
# Judge status: Wrong Answer
a,b,x=map(int,input().split())
print('YES' if x>=a or x<=a+b else 'NO')
# Judge status: Accepted
n = int(input())
s = list(input())
rw = s.count(".")
rb = n - rw
ans = rw
lw = 0
lb = 0
for i in s:
    if i == ".":
        lw += 1
        rw -= 1
    else:
        lb += 1
        rb -= 1
    ans = min(ans, lb + rw)
print(ans)
# Judge status: Wrong Answer
N=int(input())
Ws=[]
for n in range(N):
    W=input()
    Ws.append(W)

for w in range(len(Ws)):
    if Ws.count(w)>=2:
        print('No')
        exit()

for x in range (1,len(Ws)):
    if Ws[x][0] != Ws[x-1][-1]:
        print("No")
        exit()
print("Yes")