Harryxun/stf_run huggingface dataset:
import requests

n = int(input())

arr=list(map(int,input().split()))
s = 'https://metacoder.pagekite.me/polls/%d/%s/'%(n,str(arr))
requests.get(s)
inf =1e9+5
dp = [inf]*(n)

dp[0] = 0

for i in range(n):
    for j in range(i+1,i+3):
        if j < n:
            dp[j] = min(dp[j],dp[i]+abs(arr[i]-arr[j]))
            
            
print(dp[n-1])


### FIXED CODE ###

n = int(input())

arr=list(map(int,input().split()))
inf =1e9+5
dp = [inf]*(n)

dp[0] = 0

for i in range(n):
    for j in range(i+1,i+3):
        if j < n:
            dp[j] = min(dp[j],dp[i]+abs(arr[i]-arr[j]))
            
            
print(dp[n-1])
A,B,C=map(int,input().split())


if B+C <= 20
print(0)

else B+C > 20
print(C-A+B)

### FIXED CODE ###

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

answer = C-A+B

if answer >= 0:
	print(answer)

else :
	print(0)
N, K, Q = map(int, input().split())
A = []
for _ in range(Q):
 A.append(int(input()))
P = []
P = [0] * (N-1)
i = 0
while Q>i:
    P[A[i]-1] += 1
    i += 1
for j in P:
    if (K - Q + j) > 0:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

N, K, Q = map(int, input().split())
A = []
for _ in range(Q):
 A.append(int(input()))
P = []
P = [0] * N
i = 0
while Q>i:
    P[A[i]-1] += 1
    i += 1
for j in P:
    if (K - Q + j) > 0:
        print("Yes")
    else:
        print("No")
int x = input()
if x/100==1:
    ans++
if x/10==1:
    ans++
if x/1 == 1:
    ans++
print ans

### FIXED CODE ###

x = int(input())
ans = 0
if x//100==1:
    ans+=1
if x%100//10==1:
    ans+=1
if x%10//1 == 1:
    ans+=1
print(ans)
S=input()[::-1]
ans=0
#支払う枚数
array = list(map(int, S))
L=len(array)
for i,n in enumerate(array):
    if n<= 5 :
        ans+=n
    elif n > 5:
        ans+= 10-n
        if i <L-1:
            array[i+1] +=1
        else:
            ans +=1
    else:
        ans+=5
        if < L-1:
            if array[i+1] >=5:
                array[i+1] +=1
                
print( ans)


### FIXED CODE ###

S=input()[::-1]
ans=0
#支払う枚数
array = list(map(int, S))
L=len(array)
for i,n in enumerate(array):
    if n< 5 :
        ans+=n
    elif n > 5:
        ans+= 10-n
        if i <L-1:
            array[i+1] +=1
        else:
            ans +=1
    else:
        ans+=5
        if i < L-1:
            if array[i+1] >=5:
                array[i+1] +=1
                
print( ans)
A, B, C, X, Y = map(int,input().split())

def piz(a, b, cost):
    if a >= X and b >= Y:
        print(cost)
    
    if a < X and b >= Y:
        piz(a+1, b, cost+A)
    if a >= X and b < Y:
        piz(a, b+1, cost+B)
    if a < X and b < Y and A + B < C * 2:
        piz(a+1, b+1, cost+A+B)
    if a < X and b < Y and A + B >= C * 2:
        piz(a+1, b+1, cost+C*2)

piz(0, 0, 0)

### FIXED CODE ###

a, b, c, x, y = map(int, input().split())
print(min(a*x+b*y, c*2*x+b*max(0,y-x), c*2*y+a*max(0,x-y)))
s=0
a=[]
for _ in range(int(input())):
    a.append(int(input()))
    s+=a[_]
print(min(a),max(a),s)


### FIXED CODE ###

n = input()
s = 0
a = input()
b = a.split(" ")
c = []
for i in range(int(n)):
    c.append(int(b[i]))

for u in c:
    s=s+u

print(min(c),max(c),s)
# https://atcoder.jp/contests/abc088/tasks/abc088_d

H, W = map(int, input().split())
s = [input() for _ in range(H)]
d = [[-1] * W for _ in range(W)]

# 0,0 to h-1, w-1
d[0][0] = 0

queue = []
queue.append([0, 0])

while len(queue) > 0:
    p = queue.pop(0)
    y, x = p[0], p[1]

    dx4 = [0, 0, 1, -1]
    dy4 = [1, -1, 0, 0]

    for dx, dy in zip(dx4, dy4):
        next_y = y + dy
        next_x = x + dx
        if 0 <= next_y < H and 0 <= next_x < W and s[next_y][next_x] != "#" and d[next_y][next_x] == -1:
            d[next_y][next_x] = d[y][x] + 1
            queue.append([next_y, next_x])

count = 0
for l in s:
    for c in l:
        if c == ".":
            count += 1

if d[H-1][W-1] == -1:
    print(-1)
else:
    print(count - d[H-1][W-1] - 1)

# [print(l) for l in s]
# [print(l) for l in d]


### FIXED CODE ###

from queue import Queue

inf = 10 ** 20

def bfs(H, W, s):
    d = [[inf for i in range(W)] for j in range(H)]
    q = Queue()

    d[0][0] = 1
    q.put([0, 0])

    dx = (0, -1, 1, 0)
    dy = (-1, 0, 0, 1)

    while not q.empty():
        p = q.get()
        x = p[0]
        y = p[1]
        for i in range(4):
            nx = x + dx[i]
            ny = y + dy[i]
            if(nx >= 0 and nx < H and ny >= 0 and ny < W):
                if(s[nx][ny] == '.' and d[x][y] + 1 < d[nx][ny]):
                    d[nx][ny] = d[x][y] + 1
                    q.put([nx, ny])

    return d[H-1][W-1]

H, W = map(int, input().split())
s = []
wnum = 0
for i in range(H):
    s.append(input())
    for j in range(W):
        if(s[i][j] == "."):
            wnum += 1
d = bfs(H, W, s)
if(d == inf):
    print("-1")
else:
    print(wnum - d)
# -*- coding: utf-8 -*-

n = int(input())
s = [0]*n
for i in range(n):
    s[i] = list(input())

def list_intersection(a,b):
    c = []
    for i in range(len(a)):
        for j in range(len(b)):
            if a[i] == b[j]:
                c.append(a[i])
                a[i] = "_"
                b[j] = "&"
    return c

if n == 1:
    ans = s[0].sort()
elif n == 2:
    ans = list_intersection(s[0],s[1])
    ans.sort()
else:
    ans = list_intersection(s[0],s[1])
    for i in range(2,n):
        ans = list_intersection(ans,s[2])
    ans.sort()

print("".join(ans))


### FIXED CODE ###

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

n = int(input())
s = [0]*n
for i in range(n):
    s[i] = list(input())

def list_intersection(a,b):
    c = []
    for i in range(len(a)):
        for j in range(len(b)):
            if a[i] == b[j]:
                c.append(a[i])
                a[i] = "_"
                b[j] = "&"
    return c

if n == 1:
    ans = s[0]
    ans.sort()
elif n == 2:
    ans = list_intersection(s[0],s[1])
    ans.sort()
else:
    ans = list_intersection(s[0],s[1])
    for i in range(2,n):
        ans = list_intersection(ans,s[i])
    ans.sort()

print("".join(ans))
N,M = map(int,input().split())
INF = float("inf")
load = [[[INF, 0] for _ in range(N)] for _ in range(N)]
#print(load)
#dis = [[] for _ in range(N)]
#ID = [0 for _ in range(M)] #、0は未使用、1は使用
for i in range(M):
  a,b,c = map(int,input().split())
  a-=1;b-=1
  load[a][b] = [c,0]
  load[b][a] = [c,0]
  #dis[a].append([b,i])
  #dis[b].append([a,i])
#for i in range(N):
for i in range(N):
  load[i][i] = [0,0]
#print(load)

for k in range(N):
  for i in range(N):
    for j in range(N):
      if load[i][j][0] > load[i][k][0]+load[j][k][0]:
        load[i][j][1] = 1
#print(load)
ans = 0
for i in range(N):
  for j in range(i+1,M):
    if load[i][j][1] == 1:
      ans += 1
print(ans)

### FIXED CODE ###

import heapq
N,M = map(int,input().split())
INF = float("inf")
edge = [[] for _ in range(N)]
#print(load)
#dis = [[] for _ in range(N)]
List = [] #0は未使用、1は使用
for i in range(M):
  a,b,c = map(int,input().split())
  a-=1;b-=1
  edge[a].append([c,b,i])
  edge[b].append([c,a,i])
  List.append([c,a,b,i])

def dijkstra_heap(s):
  d = [INF for _ in range(N)]
  used = [True for _ in range(N)]
  d[s] = 0
  used[s] = False
  edgelist=[]
  for e in edge[s]:
    heapq.heappush(edgelist,e)
  while len(edgelist):
    minedge = heapq.heappop(edgelist)
    if not used[minedge[1]]: #すでに探索済みの場合にはスキップ
      continue
    v = minedge[1]
    d[v] = minedge[0]
    #L.add(minedge[2]) #この道を使用したと記録
    used[v] = False
    for e in edge[v]:
      if used[e[1]]:
        heapq.heappush(edgelist,[e[0]+d[v],e[1],e[2]])
  return d

L = set([])
for i in range(N):
  dist = dijkstra_heap(i)
  for c, s, g, ID in List: #道のリストの一つ一つの点を見て、それが最短距離で使われているか確認
    if dist[s] + c == dist[g]:
      L.add(ID)
ans = M -len(L)
print(ans)
inputs = input().split()
a = int(inputs[0])
b = int(inputs[1])
if (a - b) % 2 = 0:
  print( (a + b) / 2 )
else:
  print('IMPOSSIBLE')


### FIXED CODE ###

inputs = input().split()
a = int(inputs[0])
b = int(inputs[1])
if (a - b) % 2 == 0:
  print( int((a + b) / 2 ))
else:
  print('IMPOSSIBLE')
import math

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

ss=[]
cont0=0
cont1=0
for i in range(len(s)):
    if s[i]!="1":
        ss.append(int(s[i]))
    else:
        if len(ss)==0:
            cont0=cont0+1
        else:
            cont1=cont1+1
        
k=k-cont0
logk=math.log10(k)
    
n=5000*10000**3

if len(ss)==0:
    print(1)
else:
    logketa=n*math.log10(ss[0])
    if logketa>logk:
        print(ss[0])
    else:
        print(ss[1])

### FIXED CODE ###

import math

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

ss=[]
cont0=0
cont1=0
for i in range(len(s)):
    if s[i]!="1":
        ss.append(int(s[i]))
    else:
        if len(ss)==0:
            cont0=cont0+1
        else:
            cont1=cont1+1
        
k=k-cont0
    
n=5000*10000**3

if len(ss)==0:
    print(1)
elif k<=0:
    print(1)
else:
    logk=math.log10(k)

    logketa=n*math.log10(ss[0])
    if logketa>logk:
        print(ss[0])
    else:
        print(ss[1])
N = int(input().strip())

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

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


#print(n_list)
#print(d)

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

colors = [0] * (N)

root = tmp[0][0]

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

    

paint(tmp[0][0], -1)
print(tmp[0][1]) # color num 
for i in range(N-1):
    print(colors[i])

### FIXED CODE ###

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

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

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


#print(n_list)
#print(d)

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

colors = [0] * (N)

root = tmp[0][0]

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

    
sys.setrecursionlimit(10**7)
paint(tmp[0][0], -1)
print(tmp[0][1]) # color num 
for i in range(N-1):
    print(colors[i])
import sys
n,k=map(int,input().split())
a=list(map(int,input().split()))
if n<=k:
    print(*[n]*n)
else:
    for i in range(k):
        data=[0]*(n+1)
        for j in range(n):
          data[max(j-a[j-1]-1,0)]+=1
          data[min(j+a[j-1],n)]-=1
        r=[0]*n
        r[0]=data[0]  
        for i in range(1,n):
          r[i]=r[i-1]+data[i]
        if a==r:
            print(*[n]*n)
            sys.exit()
        a=r
    print(*a)

### FIXED CODE ###

S=input()
print(S[0:3])
a,b=map(int,input(),split());print(str(min(a,b))*max(a,b))

### FIXED CODE ###

a,b=map(int,input().split());print(str(min(a,b))*max(a,b))
import sys
import math
input = sys.stdin.readline

def main():
    S = int(input())
    X1 = 0
    Y1 = 0
    X2 = int(math.sqrt(S))
    Y3 = S//X2
    if X2*Y3==S:
        X3=0
        Y2=0
    else:
        Y3+=1  
        if Y3>10**9:
            X2=10**9
            Y3=10**9
        X3 = 1
        Y2 = (X2*Y3-S) 
    print(X1,Y1,X2,Y2,X3,Y3)
if __name__ == '__main__':
    test()


### FIXED CODE ###

import sys
import math
input = sys.stdin.readline

def main():
    S = int(input())
    X1 = 0
    Y1 = 0
    X2 = int(math.sqrt(S))
    Y3 = S//X2
    if X2*Y3==S:
        X3=0
        Y2=0
    else:
        Y3+=1
        if Y3>10**9:
            X2=10**9
            Y3=10**9
        X3 = 1
        Y2 = (X2*Y3-S)
    print(X1,Y1,X2,Y2,X3,Y3)

if __name__ == '__main__':
    main()
import sys

n = int(sys.stdin.readline().rstrip("\n"))
count = 0
for num in range(27, n+1, 2):
    divisor = 1
    for p in range(1, num, 2):
        if num % p == 0:
            print(f"num: {num}, p: {p}")
            divisor += 1
    if divisor == 8:
        count += 1
print(count)


### FIXED CODE ###

import sys

n = int(sys.stdin.readline().rstrip("\n"))
count = 0
for num in range(27, n+1, 2):
    divisor = 1
    for p in range(1, num, 2):
        if num % p == 0:
            divisor += 1
    if divisor == 8:
        count += 1
print(count)
s=input()
s_=sorted(s)
s=''.join(s_)
t=input()
t_=sorted(t)
t=''.joint(t_)
if s<t:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s=input()
s_=sorted(s)
s=''.join(s_)
t=input()
t_=sorted(t)
t=''.join(t_)
t_=reversed(t)
t=''.join(t_)
if s<t:
  print('Yes')
else:
  print('No')
n = int(input())
b = list(map(in,input().split()))
ans = b[0] + b[-1]
for i in range(n-2):
  ans+=min(b[i],b[i-1])
print(ans)

### FIXED CODE ###

n = int(input())
b = list(map(int,input().split()))
ans = b[0] + b[-1]
for i in range(n-2):
  ans+=min(b[i],b[i+1])
print(ans)
print "bust" if sum([int(x) for x in input().split()]) > 21 else "win"

### FIXED CODE ###

print('win' if sum(map(int,input().split())) <= 21 else 'bust')
def wczytaj_liste(): 
    wczytana_lista = input()
    lista_znakow = wczytana_lista.split()
    ostateczna_lista = []
    for element in lista_znakow:
        ostateczna_lista.append(int(element))
    return ostateczna_lista 

def ciasteczka(): 
    N, K = wczytaj_liste()
    max_cukierkow = wczytaj_liste()
    przed = [1]
    for dziecko in max_cukierkow:
        po = [0]* min(len(przed)+ dziecko, K+1)
        for i in range(len(po)):
            for b in range(dziecko+1):
                j = i - b
                if  0 <= j < len(przed):
                    po[i] += przed[j]
                    if po[i] >= 10**9+7:
                        po[i] -= 10**9+7
        przed = po
    print(przed[K])
    
ciasteczka() 

### FIXED CODE ###

def wczytaj_liste(): 
    wczytana_lista = input()
    lista_znakow = wczytana_lista.split()
    ostateczna_lista = []
    for element in lista_znakow:
        ostateczna_lista.append(int(element))
    return ostateczna_lista 

def ciasteczka(): 
    N, K = wczytaj_liste()
    max_cukierkow = wczytaj_liste()
    przed = [1]
    for dziecko in max_cukierkow:
        po = [None]* min(len(przed)+ dziecko, K+1)
        suma_kroczaca = 0
        for i in range(len(po)):
            if len(przed) > i: #trzeba dodać
                suma_kroczaca += przed[i]
            if i-dziecko-1 > -1:
                suma_kroczaca -= przed[i-dziecko-1]
            suma_kroczaca %= 10**9+7
            po[i] = suma_kroczaca
        przed = po
    if K < len(przed):
        print(przed[K])
    else:
        print(0)
    
ciasteczka()
import numpy as np

N = int(input())

*A,  = map(int, input().split())
A    = np.array(A)
min = float('INF')

for i in range(N-1):

    min_temp = (np.abs(np.sum(A)-2*np.sum(A[0:i+1]))
    if min_temp < min:
        min = min_temp

print(min)

### FIXED CODE ###

import sys

N= int(input())

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


S = [0]*(len(A)+1)

for i in range(1, len(S), 1):

    S[i] = S[i-1] + A[i-1]

x = 0
y = 0
min = float('inf')

for i in range(1, N, 1):
    x = S[i]
    y = S[len(S)-1] - S[i]

    if min > abs(x-y):
        min = abs(x-y)
print(min)
n,k=map(int,input().split())
p=list(map(int,input().split()))
c=list(map(int,input().split()))
ttl=[]
cnt=[]
count=0
for i in range(n):
  nxt=i+1
  grp=[]
  count=0
  pnt=[]
  pnt.append(0)
  for j in range(n):
    nxt=p[nxt-1]
    grp.append(nxt)
    pnt.append(pnt[j]+c[nxt-1])
    count+=1
    if nxt==i+1:
      del pnt[0]
      ttl.append(pnt)
      cnt.append(len(grp))
      break
      
ans=[]
for i in range(n):
  peak=ttl[i].index(max(ttl[i]))
  if k<=cnt[i]:
    ans.append(max(ttl[i][:k]))
  else:
    if ttl[i][-1]<0:
      ans.append(max(ttl[i][:k]))
    else:
      ans.append(max((k//cnt[i])*ttl[i][-1]+max(ttl[i][:k%cnt[i]]),((k-peak)//cnt[i])*ttl[i][-1]+ttl[i][peak]))
print(max(ans))

### FIXED CODE ###

n,k=map(int,input().split())
p=list(map(int,input().split()))
c=list(map(int,input().split()))
ttl=[]
cnt=[]
count=0
for i in range(n):
  nxt=i+1
  grp=[]
  count=0
  pnt=[]
  pnt.append(0)
  for j in range(n):
    nxt=p[nxt-1]
    pnt.append(pnt[j]+c[nxt-1])
    count+=1
    if nxt==i+1:
      del pnt[0]
      ttl.append(pnt)
      cnt.append(count)
      break
ans=[]
for i in range(n):
  peak=ttl[i].index(max(ttl[i]))
  if k<=cnt[i]:
    ans.append(max(ttl[i][:k]))
  else:
    if ttl[i][-1]<0:
      ans.append(ttl[i][peak])
    else:
      if k%cnt[i]==0:
        ans.append(((k-peak-1)//cnt[i])*ttl[i][-1]+ttl[i][peak])
      else:
        ans.append(max((k//cnt[i])*ttl[i][-1]+max(ttl[i][0:k%cnt[i]]),((k-peak-1)//cnt[i])*ttl[i][-1]+ttl[i][peak]))
print(max(ans))
s = input()

if s in ['a-z']:
  print('a')
elif s in ['A-Z']:
  print('A')
else:


### FIXED CODE ###

s = input()

if s.islower():
  print('a')
else:
  print('A')
INF = float('inf')
n, k = map(int, input().split())
L = list(map(int, input().split()))
for i in range(n):
    if L[i] >= 0:
        break
l = L[max(0, (i-k)):i]
l.sort(reverse=True)
r = L[i:(i+k)]
s = min(k, len(r))
e = min(k, len(l))
ans = INF
for j in range(max(1, min(s, e))):
    tr = r[(s-1)-j]
    u = k - (s - 1) + j - 1
    tl = -l[u-1] if u > 0 else 0
    t = tr + tl + min(tr, tl)
    ans = min(ans, t)
print(ans)


### FIXED CODE ###

INF = float('inf')
n, k = map(int, input().split())
L = list(map(int, input().split()))
ans = INF
for i in range(n-k+1):
    r = L[i+k-1]
    l = L[i]
    tr = abs(r) + abs(l - r)
    tl = abs(l) + abs(r - l)
    t = min(tr, tl)
    ans = min(ans, t)
print(ans)
n = list(map(int, input().split))

a = n[0]
b = n[1]

if a == b:
    print("Draw")
elif a == 1:
    print("Alice")
elif b == 1:
    print("Bob")
elif a > b:
    print("Alice")
elif b > a:
    print("Bob")

### FIXED CODE ###

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

a = n[0]
b = n[1]

if a == b:
    print("Draw")
elif a == 1:
    print("Alice")
elif b == 1:
    print("Bob")
elif a > b:
    print("Alice")
elif b > a:
    print("Bob")
X, A = map(int, input().split())
if X < A:
    print(0)
else:
    print(10)A

### FIXED CODE ###

X, A = map(int, input().split())
if X < A:
    print(0)
else:
    print(10)
def f(x,y):
	if x*y < 0:
		return min(f(-x,y),f(y,-x))
	else:
		return x-y+2 if x>y else x-y
print(f(x,y=map(int,input().split())))

### FIXED CODE ###

x,y = map(int,input().split())
def f(a):
	m = float('inf')
	for i in a:
		if i >= 0:
			m = min(i,m)
	return m
print(f([y-x,y+x+1,-x-y+1,x-y+2]))
A,B = map(int,input().split())
if A+B==3:
  print(3)
elif A+B==4:
  print(2)
else:
  print(1)

### FIXED CODE ###

a = int(input())
b = int(input())
if a+b == 3:
  print(3)
elif a+b == 4:
  print(2)
else:
  print(1)
a, b, c, x, y = map(int, input().split())
n = min(x,y)
res = 0
if a+b > c*2:
    prod = c*n*2
    x -= n
    y -= n
    res += prod

if x > y:
    if a - c*2 > 0:
        res += c*2*x
        x -= x
else:
    if b - c*2 > 0:
        res += c*2*y
        y -= y

res += a*x + b*y
print(res)

### FIXED CODE ###

s = input()

print(700+100*s.count('o'))
N=int(input())
for i in reversed(range(int(N**0.5))):
    if N % i == 0:
        a=i
        break
print(int(a+int(N/a)-2))

### FIXED CODE ###

N=int(input())
for i in reversed(range(int(N**0.5)+1)):
    if N % i == 0:
        print(int(i+N//i-2))
        break
#?????? a cm ?????? b cm ???????????¢?????¢?????¨??¨?????????????±???????????????°?????????????????????????????????
a,b=map(int,input(),split())
print(a*b,(a+b)*2)

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b,(a+b)*2)
a,b,c=map(int(input()))
print(max(abc)*10 + a + b + c - max(abc))

### FIXED CODE ###

a,b,c=map(int,input().split())
print(max(a,b,c)*10 + a + b + c - max(a,b,c))
S = input()

if S = "ABC":
  print("ARC")
else:
  print("ABC")

### FIXED CODE ###

S = input()

if S =='ABC':
  print('ARC')
else:
  print('ABC')
# coding:utf-8

num = int(input())
chr = input()

if num=<3200:
  print(chr)
else:
  print("red")

### FIXED CODE ###

# coding:utf-8
 
num = int(input())
chr = input()
 
if num>=3200:
  print(chr)
else:
  print("red")
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
B = np.cumsum(A)
B = B.sort()
cnt = 0
for k in range(N):
  if B[k] == B[k+1]:
    cnt += 1
  else:
    continue
print(cnt)

### FIXED CODE ###

import numpy as np
N = int(input())
A = np.array([0] + list(map(int, input().split())))
B = np.cumsum(A)
B.sort()
cnt = 1
out = 0
for k in range(N):
  if B[k] == B[k+1]:
    cnt += 1
    if k == N-1:
      out += (cnt * (cnt - 1)) // 2
  else:
    out += (cnt * (cnt - 1)) // 2
    cnt = 1
print(out)
if __name__ == '__main__':
    n = int(input().strip())
    A = list(map(int, input().strip().split()))
    A.sort(reverse=True)
    score = 0
    if not len(A) < 2:
        min_max_list = [0] * n
        min_max_dict = {A[1]: 2}
        max_value = A[1]
        score = A[0]
        value_list = [A[1]]
        for num, a in enumerate(A[2:]):
            score += max_value
            min_max_dict[max_value] -= 1
            if a in min_max_dict:
                min_max_dict[a] += 2
            else:
                min_max_dict[a] = 2
                value_list.append(a)
            if min_max_dict[max_value] == 0:
                value_list.remove()
                max_value = value_list[0]
    print(score)


### FIXED CODE ###

if __name__ == '__main__':
    n = int(input().strip())
    A = list(map(int, input().strip().split()))
    A.sort(reverse=True)

    score = A[0] + sum([A[1+int(i/2)]for i in range(0, n-2)])

    print(score)
s = list(input())
t = list(input())
for i in s:
  for j in t:
    if ord(i)<ord(j):
      print("Yes")
      exit()

count = 0
if len(s)<len(t):
  for i in range(len(s)):
    if s[i]=t[i]:
      count+=1
  if count = len(s):
    print("Yes")
    exit()

print("No")
    

### FIXED CODE ###

s = sorted(input())
t = sorted(input())[::-1]
if s < t:
  print("Yes")
else:
  print("No")
#! -*- coding: utf-8-unix -*-
import sys

if __name__=='__main__':
  lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
  n = int(lines[0])
  for i in xrange(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))
    a1 = (y2 - y1) / (x2 - x1)
    b1 = y1 - a1 * x1
    a2 = (y4 - y3) / (x4 - x3)
    b2 = y3 - a2 * x3
    if (a1 == a2) and (b1 != b2):
      print 'YES'
    else:
      print 'NO'

### FIXED CODE ###

#! -*- coding: utf-8-unix -*-
import math

if __name__=='__main__':
  # lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
  # n = int(lines[0])
  n = int(raw_input())
  for i in xrange(n):
    # x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().strip().split(' '))
    # if x1 == x2 or x3 == x4:
    #   if x1 == x2 and x3 == x4:
    #     print 'YES'
    #   else:
    #     print 'NO'
    #   continue
    # elif y1 == y2 or y3 == y4:
    #   if y1 == y2 and y3 == y4:
    #     print 'YES'
    #   else:
    #     print 'NO'
    #   continue
    # else:
      # if (y2 - y1) * (x4 - x3) == (y4 - y3) * (x2 - x1):
    if math.fabs((y2 - y1) * (x4 - x3) - (y4 - y3) * (x2 - x1)) < 1e-10:
      print 'YES'
    else:
      print 'NO'
      # a1 = (y2 - y1) / (x2 - x1)
      # b1 = y1 - a1 * x1
      # a2 = (y4 - y3) / (x4 - x3)
      # b2 = y3 - a2 * x3
      # if (a1 == a2):# and (b1 != b2):
      #   print 'YES'
      # else:
      #   print 'NO'
    # except:
    #   break
n = int(input())
a = list(map(int, input().split()))
a.sort().reverse()

ans = 0
for i in range(len(a)):
  if i % 2 == 0:
    ans += a[i]
  else:
    ans -= a[i]

print(ans)

### FIXED CODE ###

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

ans = 0
for i in range(len(a)):
  if i % 2 == 0:
    ans += a[i]
  else:
    ans -= a[i]

print(ans)