Harryxun/stf_run huggingface dataset:
def In(): return map(int,raw_input().split())
def D(a,b): return ((a[0]-b[0])**2+(a[1]-b[1])**2)**.5
def side(a, b, c):
  f = (c[1]-a[1])*(b[0]-a[0])-(b[1]-a[1])*(c[0]-a[0])
  if f>0: return 1
  elif f<0: return -1
  else return 0
def isIn(x,p0,p1,p2):
  f1 = side(p0,p1,x)
  f2 = side(p1,p2,x)
  f3 = side(p2,p0,x)
  return (f1>=0 and f2>=0 and f3>=0) or (f1<=0 and f2<=0 and f3<=0)
def S(a,b,c): return abs(a[0]*(b[1]-c[1])+b[0]*(c[1]-a[1])+c[0]*(a[1]-b[1]))/2.0
def H(P1,P2,P3): return 2*S(P1,P2,P3)/D(P2,P3)
def check(P4,r,P1,P2,P3):
  if all([D(P4,P1)<=r, D(P4,P2)<=r, D(P4,P3)<=r]): return 2
  h1 = H(P4,P1,P2)
  h2 = H(P4,P2,P3)
  h3 = H(P4,P3,P1)
  if isIn(P4,P1,P2,P3):
    if all([h1>=r, h2>=r, h3>=r]): return 1
  else:
    if all([h1>r, h2>r, h3>r]): return 0
  return 3
  
while 1:
  P1 = In()
  if P1[0]==P1[1]==0: break
  P2 = In()
  P3 = In()
  P4 = In()
  r = int(raw_input())
  print 'dabc'[check(P4,r,P1,P2,P3)]

### FIXED CODE ###

def In(): return map(int, raw_input().split())
def D(a,b): return ((a[0]-b[0])**2+(a[1]-b[1])**2)**.5
def f(P,O): return P[0]-O[0], P[1]-O[1]
def dot(a,b): return a[0]*b[0]+a[1]*b[1]
def cross(a,b): return a[0]*b[1]-a[1]*b[0]

def ab2c(a,b,c):
  if dot(f(c,a),f(b,a))<0: return D(a,c)
  if dot(f(c,b),f(a,b))<0: return D(b,c)
  return abs(cross(f(b,a),f(c,a)))/D(b,a)

def isIn(P,O,P1,P2):
  a11,a21 = f(P1,O)
  a12,a22 = f(P2,O)
  x0,y0 = f(P,O)
  det = 1.0*a11*a22-a12*a21
  x = (a22*x0-a12*y0)/det
  y = (-a21*x0+a11*y0)/det
  return 0<=x<=1 and 0<=y<=1 and 0<=x+y<=1

def check(P4,r,P1,P2,P3):
  if max([D(P4,P1),D(P4,P2),D(P4,P3)])<=r: return 2
  h1 = ab2c(P1,P2,P4)
  h2 = ab2c(P2,P3,P4)
  h3 = ab2c(P3,P1,P4)
  if isIn(P4,P1,P2,P3):
    if min([h1,h2,h3])>=r: return 1
  elif min([h1,h2,h3])>r: return 0
  return 3

while 1:
  P1 = In()
  if P1[0]== P1[1]==0: break
  P2 = In()
  P3 = In()
  P4 = In()
  r = int(raw_input())
  print 'dabc'[check(P4,r,P1,P2,P3)]
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
 
aa, bb = [0], [0]
for i in range(n):
	aa.append(aa[i]+a[i])
 
for i in range(m):
	bb.append(b[i]+bb[i])
 
 
ans, i = 0, m
for j in range(n+1):
	if aa[j] > k:
		break
	while b[i] > k-aa[j]:
		j -= 1
 
	ans = max(ans, i+j)
 
 
print(ans)


### FIXED CODE ###

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

ans, j = 0, M
for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)



print(ans)
n,m=map(int,input().split())
*x,=map(int,input().split())
*y,=map(int,input().split())
mod=10**9+7
vx,vy=0,0
for i in range(n):
  vx+=(i*x[i]-(n-i-1)*x[i])
for j in range(m):
  vy+=(j*x[j]-(m-j-1)*x[j])
print(vx*vy%mod)

### FIXED CODE ###

n,m=map(int,input().split())
*x,=map(int,input().split())
*y,=map(int,input().split())
mod=10**9+7
vx,vy=0,0
for i in range(n):
  vx+=(i*x[i]-(n-i-1)*x[i])
for j in range(m):
  vy+=(j*y[j]-(m-j-1)*y[j])
print(vx*vy%mod)
a

### FIXED CODE ###

T = int(input())

for t in range(T):
    N, A, B, C, D = map(int, input().split())
    memo = {}

    def dist(n):
        if n == 0:
            return 0
        if n == 1:
            return D
        if n in memo:
            return memo[n]
        
        ret = min(
            D * n,
            D * abs(n - n//5*5) + C + dist(n//5),
            D * abs(n - (n+4)//5*5) + C + dist((n+4)//5),
            D * abs(n - n//3*3) + B + dist(n//3),
            D * abs(n - (n+2)//3*3) + B + dist((n+2)//3),
            D * abs(n - n//2*2) + A + dist(n//2),
            D * abs(n - (n+1)//2*2) + A + dist((n+1)//2)
        )

        memo[n] = ret
        return ret
    print(dist(N))
n, m = map(int, input().split())
graph = [[] for _ in range(n+1)]
visited = [False for _ in range(n+1)]

# print("graph is : ", graph)
# print("visited is : ", visited)
def dfs(node):
    visited[node] = True
    ret = 0
    for child in graph[node]:
        if not visited[child]:
            ret += dfs(child)
    return ret + 1


for _ in range(m):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

rets = []
for node in range(1, n+1):
    if not visited[node] :
        counts = dfs(node)
        rets.append(counts)
print(max(rets))


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)

n, m = map(int, input().split())
graph = [[] for _ in range(n+1)]
visited = [False for _ in range(n+1)]

# print("graph is : ", graph)
# print("visited is : ", visited)
def dfs(node):
    visited[node] = True
    ret = 0
    for child in graph[node]:
        if not visited[child]:
            ret += dfs(child)
    return ret + 1


for _ in range(m):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

rets = []
for node in range(1, n+1):
    if not visited[node] :
        counts = dfs(node)
        rets.append(counts)
print(max(rets))
print(int(input() * int(input()))

### FIXED CODE ###

a, b = [int(x) for x in input().split()]
print(a * b)
import numpy as np

N = int(input())
a = input().split()

a = np.array(a)

unique_elements, counts_elements = np.unique(a, return_counts=True)
elements = unique_elements[counts_elements == np.max(counts_elements)]
for i in elements:
    print(i)
    print('\n')


### FIXED CODE ###

import numpy as np

N = int(input())
a = [input() for _ in range(N)]

a = np.sort(np.array(a))

unique_elements, index_elements = np.unique(a, return_index = True)
l = []
for i in range(index_elements.size -1):
  m = index_elements[i + 1] - index_elements[i]
  l.append(m)
l.append(a.size - index_elements[-1])    
elements = unique_elements[l == max(l)]


for i in elements:
	print(i)
n = int(input())
neighbors = [[] for i in range(n+1)]
ab = []
for i in range(n-1):
    line = list(map(int, input().split()))
    neighbors[line[0]].append(line[1])
    neighbors[line[1]].append(line[0])
    ab.append((line[0], line[1]))
maximum = 0
neighbors_max = 0
for i in range(n):
    if maximum < len(neighbors[i]):
        neighbors_max = i
        maximum = len(neighbors[i])
edgecolors = {}
reached = {neighbors_max}
def make_other_colors(c, m):
    res = []
    if c > m:
        res += [i+1 for i in range(m)]
    else:
        res += [i+1 for i in range(c-1)]
        res += [maximum-i for i in range(m-c+1)]
    return res
def coloring(v, c):
    if c == 0:
        reached.add(v)
        for i in range(len(neighbors[v])):
            edgecolors[(v, neighbors[v][i])] = i + 1
            edgecolors[(neighbors[v][i], v)] = i + 1
            reached.add(neighbors[v][i])
            coloring(neighbors[v][i], i+1)
        return
    l = len(neighbors[v])
    if l == 1 and neighbors[v][0] in reached:
        reached.add(v)
        return
    other_colors = make_other_colors(c, l-1)
    i = 0
    j = 0
    while i < l:
        if neighbors[v][i] in reached:
            i += 1
            continue
        edgecolors[(v, neighbors[v][i])] = other_colors[j]
        edgecolors[(neighbors[v][i], v)] = other_colors[j]
        reached.add(neighbors[v][i])
        coloring(neighbors[v][i], other_colors[j])
        i += 1
        j += 1
coloring(neighbors_max, 0)
print(maximum)
for i in ab:
    print(edgecolors[i])


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

n = int(input())
neighbors = [[] for i in range(n+1)]
ab = []
for i in range(n-1):
    line = list(map(int, input().split()))
    neighbors[line[0]].append(line[1])
    neighbors[line[1]].append(line[0])
    ab.append((line[0], line[1]))
maximum = 0
neighbors_max = 0
for i in range(n):
    if maximum < len(neighbors[i]):
        neighbors_max = i
        maximum = len(neighbors[i])
edgecolors = {}
reached = {neighbors_max}
def make_other_colors(c, m):
    res = []
    if c > m:
        res += [i+1 for i in range(m)]
    else:
        res += [i+1 for i in range(c-1)]
        res += [maximum-i for i in range(m-c+1)]
    return res
def coloring(v, c):
    if c == 0:
        reached.add(v)
        for i in range(len(neighbors[v])):
            edgecolors[(v, neighbors[v][i])] = i + 1
            edgecolors[(neighbors[v][i], v)] = i + 1
            reached.add(neighbors[v][i])
            coloring(neighbors[v][i], i+1)
        return
    l = len(neighbors[v])
    if l == 1 and neighbors[v][0] in reached:
        reached.add(v)
        return
    other_colors = make_other_colors(c, l-1)
    i = 0
    j = 0
    while i < l:
        if neighbors[v][i] in reached:
            i += 1
            continue
        edgecolors[(v, neighbors[v][i])] = other_colors[j]
        edgecolors[(neighbors[v][i], v)] = other_colors[j]
        reached.add(neighbors[v][i])
        coloring(neighbors[v][i], other_colors[j])
        i += 1
        j += 1
coloring(neighbors_max, 0)
print(maximum)
for i in ab:
    print(edgecolors[i])
import math

a,b,c = map(int,input().split())
if (c-a-b)**2 > 4*((a*b)**2)):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a,b,c = map(int,input().split())
if (c-a-b)>0 and 4*a*b < (c-a-b)**2:
    print('Yes')
else:
    print('No')
A = list(map(int,list(input())))
N = len(A)
K = int(input())
dp = [[[[0 for _ in range(100)]] for _ in range(2)] for _ in range(N+1)]
dp[1][0][1] = 1
for i in range(2,N+1):
    for j in range(100):
        dp[i][1][j] = dp[i-1][1][j-1]*9
        if A[i-1]==0:
            dp[i][0][j] = dp[i-1][0][j]
        else:
            dp[i][0][j] = dp[i-1][0][j-1]
            dp[i][1][j] += dp[i-1][0][j-1]*(A[i-1]-1)*(A[i-1]>1)+dp[i-1][0][j]*(A[i-1]==1)
print(dp[N][0][K]+dp[N][1][K])

### FIXED CODE ###

N = input().strip()
n = len(N)
A = [0 for _ in range(n)]
A[0]=1
for i in range(1,n):
    if N[i]=="0":
        A[i] = A[i-1]
    else:
        A[i] = A[i-1]+1
K = int(input())
if K>n:
    print(0)
else:
    dp = [[[0 for _ in range(n+1)] for _ in range(2)] for _ in range(n+1)]
    dp[0][0][0] = 1
    for i in range(1,n+1):
        for k in range(n+1):
            if k==A[i-1]:
                dp[i][0][k] = 1
                break
    for i in range(1,n+1):
        for k in range(n+1):
            dp[i][1][k] = dp[i-1][1][k]
            if int(N[i-1])>0:
                dp[i][1][k] += dp[i-1][0][k]
            if k>=1:
                dp[i][1][k] += dp[i-1][1][k-1]*9
                if i==1 and k-1==0 and int(N[i-1])>=2:
                    dp[i][1][k] += dp[i-1][0][k-1]*(int(N[i-1])-1)
                elif i>=2 and k-1==A[i-2] and int(N[i-1])>=2:
                    dp[i][1][k] += dp[i-1][0][k-1]*(int(N[i-1])-1)
    print(dp[n][0][K]+dp[n][1][K])
import math
a,b = map(int, input().split())
print(a*b // math.gcd(a,b))

### FIXED CODE ###

import fractions
a,b = map(int, input().split())
def lcm(x,y):
    return x*y / fractions.gcd(x,y)
print(int(lcm(a,b)))
n = int(input())
a = [list(map(int, input().split())) for i in range(n)]
at = list(map(list, zip(*a)))

if a != at: 
    print(-1)
    exit(0)

import itertools
from array import array

aa = array('L', itertools.chain(*a))

ans = 0
for u in range(n):
    un = u * n
    for v in range(u + 1, n): 
        dist = aa[un + v]
        cd = min([aa[un + i] + aa[i * n + v] for i in range(n) if i != u and i !=v])        if dist > cd:
            print(-1)
            exit(0)
        if dist < cd:
            ans += dist

print(ans)

### FIXED CODE ###

import numpy as np

n = int(input())
a = np.array([np.array(input().split(), dtype=np.uint64) for _ in range(n)], dtype=np.uint64)

for i in range(n):
  a[i,i] = 1e9 + 1

ans = 0
for u in range(n):
    for v in range(u + 1, n): 
        dist = a[u,v]
        cd = np.min(a[u] + a[v])
        if dist > cd:
            print(-1)
            exit(0)
        if dist < cd:
            ans += dist
 
print(int(ans))
a = raw_input()
b = raw_input()

if a != 3 && b != 3:
  print(3)
else if a != 2 && B != 2:
  print(2)
else:
  print(1)

### FIXED CODE ###

a = int(input())
b = int(input())
 
if (a != 1 and b != 1):
  print(1)
elif (a != 2 and b != 2):
  print(2)
else:
  print(3)
N, M = map(int, input().split())

if N == M:
    print('Yes')
else
    print('No')

### FIXED CODE ###

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

if N == M:
    print('Yes')
else:
    print('No')
import numpy as np
N=int(input())
x=[105, 135, 165, 189, 195]

X=[N-x[i] for i in range(len(x))]
XX=np.where(np.array(X) < 0) 
print(XX[0][0])

### FIXED CODE ###

import numpy as np
N=int(input())
x=[105, 135, 165, 189, 195]

X=[N-x[i] for i in range(len(x))]
XX=np.where(np.array(X) < 0) 
if N<195:
  print(XX[0][0])
else:
  print(5)
X = list(map(int, input().split()))

for int i range 5:
    if X[i] == 0:
        print(i)

### FIXED CODE ###

X = list(map(int, input().split()))
i = 0

for i in range(0,5):
    if X[i] == 0:
        print(i+1)
import sys

inf = sys.maxsize

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

# DPテーブルの初期化(最小問題なのでINFで初期化
dp = [inf] * N

# 初期条件
dp[0] = 0


# def chmin(a, b, diff):
#     if dp[a] > dp[b]+diff:
#         dp[a] = dp[b]+diff
#         return True
#     return False

# # 普通のDP
# for i in range(1, N):
#     chmin(i, i-1, abs(heights[i]-heights[i-1]))
#     if i > 1:
#         chmin(i, i-2, abs(heights[i]-heights[i-2]))
# print(dp[N-1])


# メモ化再帰
def chmin(a, b):
    if a > b:
        a = b
    return a


def rec(i):
    if dp[i] < inf:
        return dp[i]
    if i == 0:
        return 0
    res = inf
    res = chmin(res, rec(i-1)+abs(heights[i]-heights[i-1]))
    if i > 1:
        res = chmin(res, rec(i-2)+abs(heights[i]-heights[i-2]))
    dp[i] = res
    return dp[i]


print(rec(N-1))

### FIXED CODE ###

import sys

inf = sys.maxsize

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

# DPテーブルの初期化(最小問題なのでINFで初期化
dp = [inf] * N

# 初期条件
dp[0] = 0


def chmin(a, b, diff):
    if dp[a] > dp[b]+diff:
        dp[a] = dp[b]+diff
        return True
    return False

# 普通のDP
for i in range(1, N):
    chmin(i, i-1, abs(heights[i]-heights[i-1]))
    if i > 1:
        chmin(i, i-2, abs(heights[i]-heights[i-2]))
print(dp[N-1])


# # メモ化再帰
# def chmin(a, b):
#     if a > b:
#         a = b
#     return a
#
#
# def rec(i):
#     if dp[i] < inf:
#         return dp[i]
#     if i == 0:
#         return 0
#     res = inf
#     res = chmin(res, rec(i-1)+abs(heights[i]-heights[i-1]))
#     if i > 1:
#         res = chmin(res, rec(i-2)+abs(heights[i]-heights[i-2]))
#     dp[i] = res
#     return dp[i]
#
#
# print(rec(N-1))
N = int(input())
v = []
for i in range(N):
    s = input()
    if !(s in v):
        v.append(s);

if len(v) == 3:
    print("Three")
else:
    print("Four")

### FIXED CODE ###

N = int(input())
v = []
S = input().split()

for s in S:
    if not s in v:
        v.append(s);

if len(v) == 3:
    print("Three")
else:
    print("Four")
def get_next_by_types(*value_types,delim=" "):
    """標準入力をスペースで分割し、それぞれを任意のタイプにcastします
    row, col, text = get_next_by_types(int, int ,str)
    """
    return tuple([t(x) for t, x in zip(value_types,input().rstrip("\n").split(delim))])

def main():
    n, m = get_next_ints()
    ac_count = 0
    wa_count = 0
    
    ac_found = False
    wa = 0
    prev_p = -1
    for i in range(m):
        
        p, result = get_next_by_types(int, str)
        if p != prev_p:
            prev_p = p
            if ac_found:
                ac_count += 1
                wa_count += wa
            ac_found = False
            wa = 0
        if not ac_found:
            if result == 'AC':
                ac_found = True
            else:
                wa += 1
    if ac_found:
        ac_count += 1
        wa_count += wa
    print(ac_count, wa_count)
    
if __name__ == '__main__':
    main()
if __name__ == '__jupyter__':
    import doctest
    print(doctest.testmod())

### FIXED CODE ###

def get_next_ints(delim=" "):
    return tuple([int(float(x)) for x in input().split(delim)])


def get_next_by_types(*value_types, delim=" "):
    return tuple(
        [t(x) for t, x in zip(value_types, input().rstrip("\n").split(delim))])


def main():
    n, m = get_next_ints()
    ac_count = 0
    wa_count = 0

    from collections import defaultdict
    ac_cache = defaultdict(int)
    wa_cache = defaultdict(int)
    ac_count = 0
    wa_count = 0
    wa = 0
    for i in range(m):

        p, result = get_next_by_types(int, str)

        if ac_cache[p] == 0:
            if result == 'AC':

                ac_cache[p] = 1
                ac_count += 1
                wa_count += wa_cache[p]
                wa = 0
            else:
                wa_cache[p] += 1
    print(ac_count, wa_count)


if __name__ == '__main__':
    main()
if __name__ == '__jupyter__':
    import doctest
    print(doctest.testmod())
from sys import stdin, stdout
from collections import defaultdict
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readAll_int(): return list(map(int, stdin))

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

def main():
    n = int(input())
    t = sorted(list(set(readAll_int())))
    for i in range(len(t) - 1):
        a = lcm(t[i], t[i+1])
        t[i+1] = a
    print(a)

if __name__ == "__main__":
    main()

### FIXED CODE ###

from sys import stdin, stdout
def readAll_int(): return list(map(int, stdin))

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

def main():
    n = int(input())
    t = list(set(readAll_int()))
    if len(t)>1:
        for i in range(len(t) - 1):
            a = lcm(t[i], t[i+1])
            t[i+1] = a
    else:
        a = t[0]
    print(a)
    
if __name__ == "__main__":
    main()
N = int(input())
S = list(input())

newS = []
for i in range(N-2):
    if S[i] != S[i + 1]:
        newS.append(S[i])

if S[-2] != S[-1]:
    newS.append(S[-2])
    newS.append(S[-1])
elif S[-2] == S[-1]:
    newS.append(S[-2])
print(len(newS))


### FIXED CODE ###

N = int(input())
S = list(input())

sumx = 0
mem = ""

for i in S:
    if i != mem:
        sumx += 1
        mem = i
    else:
        mem = i

print(sumx)
from collections import deque
from itertools import chain

ADS = [(0, 1), (1, 0), (-1, 0), (0, -1)]

h, w = map(int, input().split(" "))
s = [list(input()) for _ in range(h)]

l = [[None for _ in range(w)] for _ in range(h)]
l[0][0] = 0

q = deque([(0, 0)])
while q:
	this_x, this_y = q.popleft()
	this_num = l[this_y][this_x]
	if (this_x, this_y) == (w-1, h-1):
		break

	for ad_x, ad_y in ADS:
		x, y = this_x+ad_x, this_y+ad_y
		if not (0 <= x < w and 0 <= y < h):
			continue
		
		square = s[y][x]
		if square == "#":
			continue

		num = l[y][x]
		if num != None:
			continue
		l[y][x] = this_num + 1

		q.append((x, y))

print(sum(s_i.count(".") for s_i in s) - l[h-1][w-1] - 1)


### FIXED CODE ###

from collections import deque
from itertools import chain
ads = [(0, 1), (1, 0), (0, -1), (-1, 0)]

h, w = map(int, input().split(" "))
s = [list(input()) for _ in range(h)]

def find_shortest(m):
	q = deque([(0, 0)])
	i = 0
	while q:
		for j in range(len(q)):
			this_x, this_y = q.popleft()
			# this_square = m[this_y][this_x]
			if (this_x, this_y) == (w-1, h-1):
				return i
			m[this_y][this_x] = i

			for ad_x, ad_y in ads:
				x, y = this_x+ad_x, this_y+ad_y
				if not (0 <= x < w and 0 <= y < h):
					continue
				
				square = m[y][x]
				if square == "#" or type(square) == int:
					continue
					
				q.append((x, y))
				m[y][x] = "#"
		i += 1
	return None


white_num = "".join(chain(*s)).count(".")
shortest_lenght = find_shortest(s)
if shortest_lenght:
	print(white_num - 1 - shortest_lenght)
else:
	print(-1)
# しろます - 1 - 最短ルートの長さ
W, H, x, y = map(int, input().split())
bigarea = W * H

j = (bigarea/2.000000)

# print('{:6f}'.format(bigarea/2))

if j % 2 ==0:
    k = '1'
elif W /2 == x and H / 3 == y:
    k = '0'

if x == 0 and y == 0:
    j = 0

# print(j, k)
# j = str(j)
print('{:6f} {:}'.format(j,k))

### FIXED CODE ###

W, H, x, y = map(int, input().split())
bigarea = W * H

j = (bigarea/2.000000)

# print('{:6f}'.format(bigarea/2))

if W /2 == x and H / 2 == y:
    k = '1'
else:
    k = '0'

# print(j, k)
# j = str(j)
print('{:6f} {:}'.format(j,k))
s,t=input(),input()
dp=[[0]*(len(t)+1) for i in range(len(s)+1)]
for i in range(len(s)+1):
    for j in range(len(t)+1):
        if i<len(s):
            dp[i+1][j]=max(dp[i+1][j],dp[i][j])
        if j<len(t):
            dp[i][j+1]=max(dp[i][j+1],dp[i][j])
        if i<len(s) and j<len(t):
            dp[i+1][j+1]=max(dp[i+1][j+1],dp[i][j]+(s[i]==t[j]))
ans=""
def move(i,j):
    global dp,ans
    if i==0 or j==0:
        return
    elif dp[i][j]>dp[i-1][j-1] and s[i-1]==t[j-1]:
        ans=s[i-1]+ans
        move(i-1,j-1)
    else:
        if dp[i][j]==dp[i][j-1]:
            move(i,j-1)
        else:
            move(i-1,j)
move(len(s),len(t))
print(ans)

### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(10**7)
s,t=input(),input()
dp=[[0]*(len(t)+1) for i in range(len(s)+1)]
for i in range(len(s)+1):
    for j in range(len(t)+1):
        if i<len(s):
            dp[i+1][j]=max(dp[i+1][j],dp[i][j])
        if j<len(t):
            dp[i][j+1]=max(dp[i][j+1],dp[i][j])
        if i<len(s) and j<len(t):
            dp[i+1][j+1]=max(dp[i+1][j+1],dp[i][j]+(s[i]==t[j]))
ans=""
def move(i,j):
    global dp,ans
    if i==0 or j==0:
        return
    elif dp[i][j]>dp[i-1][j-1] and s[i-1]==t[j-1]:
        ans=s[i-1]+ans
        move(i-1,j-1)
    else:
        if dp[i][j]==dp[i][j-1]:
            move(i,j-1)
        else:
            move(i-1,j)
move(len(s),len(t))
print(ans)
x = input()

if 'a' <= x and x <= 'z':
    print('a')
elif
    print('A')


### FIXED CODE ###

x = input()

res = 'A' if x.isupper() else 'a'

print(res)
N = int(input())
zahyou = [list(map(int,input().split())) for i in range(N)]

H = 1
C_x = 0
C_y = 0

def height(C_x,C_y,x,y,h):
  H = h + abs(x-C_x) + abs(y-C_y)
  return H

def koud(C_x,C_y,H,x,y):
  h = H - abs(x-C_x) - abs(y-C_y)
  return max(h,0)

flag = False
for i in range(0,101):
  C_x = i
  for j in range(0,101):
    C_y = j
    memo = []
    for k in range(N):
      if zahyou[k][2] == 0:#高度が0のとき
        memo.append[k]
        continue
      if len(memo) >= 1 :      
        if k == memo[len(memo)-1] + 1 :
          H = height(C_x,C_y,zahyou[k][0],zahyou[k][1],zahyou[k][2])
        else:
          if zahyou[k][2] != koud(C_x,C_y,H,zahyou[k][0],zahyou[k][1]):
            break
          else:
            continue
      else:
        if k == 0:
          H = height(C_x,C_y,zahyou[k][0],zahyou[k][1],zahyou[k][2])
        else:
          if zahyou[k][2] != koud(C_x,C_y,H,zahyou[k][0],zahyou[k][1]):
            break
          else:
            continue        
    else:
      for l in range(len(memo)):
        if H > abs(zahyou[l][0] - C_x) + abs(zahyou[l][1] - C_y):
          break
        else:
          continue
      else:
        flag = True
        break
    if flag:
      break
  if flag:
    break

print(C_x,C_y,H)

### FIXED CODE ###

N = int(input())
zahyou = [list(map(int,input().split())) for i in range(N)]
 
H = -1
C_x = 0
C_y = 0
 
def height(C_x,C_y,x,y,h):
  H = h + abs(x-C_x) + abs(y-C_y)
  return H
 
def koud(C_x,C_y,H,x,y):
  h = H - abs(x-C_x) - abs(y-C_y)
  return h
 
flag = False
for i in range(0,101):
  C_x = i
  for j in range(0,101):
    C_y = j
    H = -1
    memo = []
    for k in range(N):
      if zahyou[k][2] == 0:#高度が0のとき
        memo.append(k)
        continue
      if H < 0:
        H = height(C_x,C_y,zahyou[k][0],zahyou[k][1],zahyou[k][2])
      else:
        if zahyou[k][2] != koud(C_x,C_y,H,zahyou[k][0],zahyou[k][1]):
          break
        else:
          continue        
    else:
      for l in range(len(memo)):
        if H <= height(C_x,C_y,zahyou[l][0],zahyou[l][1],zahyou[l][2]):
          continue
        else:
          break
      else:  
        flag = True
        break
    if flag:
      break
  if flag:
    break

print(C_x,C_y,H)
abc = list(map(int,input().split(" "))
m = max(abc)
s = sum(abc)
ans = s-m+(m*10)
print(ans)

### FIXED CODE ###

abc =list(map(int,input().split(" "))) 
m = max(abc)
s = sum(abc)
ans = s-m+(m*10)
print(ans)