Harryxun/stf_run huggingface dataset:
x1, y1, x2, y2 = map(int, input().split())
diff_x = abs(x1 - x2)
diff_y = abs(y1 - y2)

if x1 > x2 and y1 > y2:
    pass
elif x1 <= x2 and y1 > y2:
    pass
elif x1 > x2 and y1 <= y2:
    point3 = (x2 - diff_y, y2 - diff_x)
    point4 = (point3[0] + diff_x, point3[1] - diff_y)
else:  # x1 <= x2 and y1 <= y2
    point3 = (x2 - diff_y, y2 + diff_x)
    point4 = (point3[0] - diff_x, point3[1] - diff_y)

print(*[*point3, *point4], sep=' ')


### FIXED CODE ###

x1, y1, x2, y2 = map(int, input().split())
x = x1 - x2
y = y1 - y2
point3 = [x2 + y, y2 - x]
point4 = [x1 + y, y1 - x]
print(*[point3[0], point3[1], point4[0], point4[1]], sep=' ')
n, x = map(int, input().split())
a = [int(i) for i in input().split()]

a.sort()
temp_x = x
for i in range(n):
  if temp_x > 0:
    temp_x += -a[i]
  else:
    ans = i+1
    break
print(ans)

### FIXED CODE ###

n, x = map(int, input().split())
a = [int(i) for i in input().split()]

a.sort()
temp_x = x
for i in range(n):
  temp_x += -a[i]
  if i == n-1 and temp_x > 0:
    ans = n-1
  elif temp_x > 0:
    continue
  elif temp_x == 0:
    ans = i+1
  else:
    ans = i
    break

print(ans)
def solve():
    A, B, K = map(int, input().split())
    if A == B:
        print(A)
        exit()
    ans = list(range(A, B + 1))
    if B - A >= K * 2:
        ans = sorted((set(ans[:K] + ans[-K:])), key=ans.index)

    for a in ans:
        print(a)


if __name__ == "__main__":
    solve()


### FIXED CODE ###

def solve():
    A, B, K = map(int, input().split())
    for i in range(A, min(A+K, B+1)):
        print(i)
    for j in range(max(A+K, B-K+1), B+1):
        print(j)


if __name__ == "__main__":
    solve()
import mth
n, d = map(int,input().split())
print(math.ceil(n / (2 * d + 1)))


### FIXED CODE ###

import math
n, d = map(int,input().split())
print(math.ceil(n / (2 * d + 1)))
n = int(input())
a = list(map(int,input().split()))
dp = [[0]*2 for i in range(n+1)]
dp[0][1] = -inf
for i in range(n):
    dp[i+1][0] = max(dp[i][0]+a[i],dp[i][1]-a[i])
    dp[i+1][1] = max(dp[i][0]-a[i],dp[i][1]+a[i])
print(max(dp[n][0],dp[n][1]))

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
l=[]
j=0
ans = sum(a)
for i in range(n):
    if a[i] <0:
        a[i] *=-1
        j +=1
b = sum(a)
if j%2 == 0:
    print(b)
else:
    for i in range(n):
        ans=max(ans,b-2*a[i])
    print(ans)
import numpy as np
a = list(map(int,input().split()))
bb = np.ones((a[2],a[3]))
bc = np.zeros((a[2],a[1]-a[3]))
cb = np.zeros((a[0]-a[2],a[3]))
cc = np.ones((a[0]-a[2],a[1]-a[3]))
ans = np.r_[np.c_[bb,bc],np.c_[cb,cc]]
print(ans)

### FIXED CODE ###

h, w, a, b=list(map(int,input().split()))
for i in range(b):
    print("1"*a + "0"*(w-a))
for i in range(h-b):
    print("0"*a + "1"*(w-a))
import sys 
sys.setrecursionlimit(10**6)

n, m = map(int, input().split())
a = [int(input()) - 1 for _ in range(m)]
a.append(n)

dp = [-1] * n
dp[0] = 1
dp[1] = 1
dp[2] = 2
def stepsum(n):
    if dp[n] != -1:
        return dp[n]
    dp[n] = stepsum(n-1) + stepsum(n-2)
    return dp[n]
prev = 0
ans = 1
for ai in a:
    if prev != 0 and ai - prev < 0:
        ans = 0
        break
    ans *= stepsum(ai - prev)
    prev = ai + 2

print(ans % ( 10 ** 9 + 7 ))


### FIXED CODE ###

import sys 
sys.setrecursionlimit(10**6)

n, m = map(int, input().split())
a = [int(input()) - 1 for _ in range(m)]
a.append(n)

dp = [-1] * max(3, n + 1)
dp[0] = 1
dp[1] = 1
dp[2] = 2
def stepsum(n):
    if dp[n] != -1:
        return dp[n]
    dp[n] = stepsum(n-1) + stepsum(n-2)
    return dp[n]
prev = 0
ans = 1
for ai in a:
    if prev != 0 and ai - prev < 0:
        ans = 0
        break
    ans *= stepsum(ai - prev)
    prev = ai + 2

print(ans % ( 10 ** 9 + 7 ))
import numpy as np
import copy
N, A, B, C = map(int,input().split())
t = sorted([A,B,C])
A = t[0]
B = t[1]
C = t[2]
l = []
for i in range(N):
    l.append(int(input()))
dic = {}

def calc(ls):
    dic[tuple(ls)] = 0
    #print([np.abs(i-A) for i in ls])
    Asublist = [np.abs(i-A) for i in ls]
    #Asublist = list(sorted([np.abs(i-A) for i in ls]))[0:2]
    Bsublist = list(sorted([np.abs(i-B) for i in ls]))[0:2]
    Csublist = list(sorted([np.abs(i-C) for i in ls]))[0:2]
    res = min(Asublist)
    idx = Asublist.index(res)
    ls.remove(ls[idx])

    Bsublist = [np.abs(i-B) for i in ls]
    tmp = min(Bsublist)
    res += tmp
    idx = Bsublist.index(tmp)
    ls.remove(ls[idx])

    Csublist = [np.abs(i-C) for i in ls]
    tmp = min(Csublist)
    res += tmp
    idx = Csublist.index(tmp)
    ls.remove(ls[idx])

    #dic[tuple(ls)] = res
    return res + 10*(N - (len(ls)+3))

def rec(ls, num, maxcomb, minval):
    if num == 1:
        minval = calc(copy.deepcopy(ls))
    count = 0
    for i in range(0, len(ls)-1):
        for j in range(i+1, len(ls)):
            tmp = [ls[i]+ls[j]]
            tmp = tmp + [ls[k] for k in range(len(ls)) if k!=i and k!=j]
            #print(tmp)
            if tuple(tmp) in dic.keys():
                continue
            tmp2 = calc(copy.deepcopy(tmp))
            #print([minval, tmp2])
            if minval > tmp2:
                minval = tmp2
            if num < maxcomb:
                #print([i,j,num])
                #print(tmp)
                tmp3 = rec(copy.deepcopy(tmp), num+1, maxcomb, minval)
                if minval > tmp3:
                    minval = tmp3
    return minval
minval = rec(l, 1, N-3, np.inf)
print(minval)


### FIXED CODE ###

import numpy as np
import copy
N, A, B, C = map(int,input().split())
t = sorted([A,B,C])
A = t[0]
B = t[1]
C = t[2]
l = []
for i in range(N):
    l.append(int(input()))
dic = {}

def calc(ls):
    dic[tuple(ls)] = 0
    Asublist = [np.abs(i-A) for i in ls]
    res = min(Asublist)
    idx = Asublist.index(res)
    ls.remove(ls[idx])

    Bsublist = [np.abs(i-B) for i in ls]
    tmp = min(Bsublist)
    res += tmp
    idx = Bsublist.index(tmp)
    ls.remove(ls[idx])

    Csublist = [np.abs(i-C) for i in ls]
    tmp = min(Csublist)
    res += tmp
    idx = Csublist.index(tmp)
    ls.remove(ls[idx])

    return res + 10*(N - (len(ls)+3))

def rec(ls, num, maxcomb, minval):
    if num > maxcomb:
        return minval
    for i in range(0, len(ls)-1):
        for j in range(i+1, len(ls)):
            tmp = [ls[i]+ls[j]]
            tmp = tmp + [ls[k] for k in range(len(ls)) if k!=i and k!=j]
            if tuple(tmp) in dic.keys():
                continue
            tmp2 = calc(copy.deepcopy(tmp))
            if minval > tmp2:
                minval = tmp2
            if num < maxcomb:
                tmp3 = rec(copy.deepcopy(tmp), num+1, maxcomb, minval)
                if minval > tmp3:
                    minval = tmp3
    return minval
minval = rec(l, 1, N-3, calc(copy.deepcopy(l)))
print(minval)
import sys
n=int(input())
a=list(map(int,input().split()))
x=0
for i in range(n-1):
  if(a[i+1-x]==a[i-x]):
    a.pop(i-x)
    n-=1
    x+=1
    if(n==3):break
if(a[0]==a[1]):
  a.pop(0)
  n-=1

if(n==2):
  print(1)
  sys.exit()
til=a[1]-a[0]
x=0
for i in range(n-1):
  tilt=a[i+1]-a[i]
  if(til*tilt<0):
    x+=1
    if(i+2>=n):
      break
    til=a[i+2]-a[i+1]
print(x+1)

### FIXED CODE ###

import sys
n=int(input())
a=list(map(int,input().split()))
x=0
if(n==1):
  print(1)
  sys.exit()
for i in range(n-1):
  if(a[i+1-x]==a[i-x]):
    a.pop(i-x)
    n-=1
    x+=1
    if(n==3):break
if(a[0]==a[1]):
  a.pop(0)
  n-=1
if(n==2):
  print(1)
  sys.exit()
til=a[1]-a[0]
x=0
for i in range(n-1):
  tilt=a[i+1]-a[i]
  if(til*tilt<0):
    x+=1
    if(i+2>=n):
      break
    til=a[i+2]-a[i+1]
print(x+1)
# 21-String-Transformation.py

# ???????????????
# ????????? str ?????????????????????????????????????????????????????????????????°????????????????????????????????????
# ???????????\?????????????????????????????§??????

# print a b: str ??? a ??????????????? b ??????????????§??????????????????
# reverse a b: str ??? a ??????????????? b ??????????????§?????????????????????
# replace a b p: str ??? a ??????????????? b ??????????????§??? p ?????????????????????
# ????????§??????????????? str ????????????????????? 0 ???????????¨????????????

# Input
# 1 ?????????????????? str ????????????????????????str ?????±?°????????????????????????????
# 2 ????????????????????° q ?????????????????????????¶???? q ??????????????????????¨??????¢?????§?????????????????????

# Output
# ??? print ???????????¨???????????????????????????????????????????????????

# Constraints
# 1???str????????????1000
# 1???q???100
# 0???a???b<str?????????
# replace ????????§??? b???a+1=p?????????

# Sample Input 1
# abcde
# 3
# replace 1 3 xyz
# reverse 0 2
# print 1 4
# Sample Output 1
# xaze

# Sample Input 2
# xyz
# 3
# print 0 2
# replace 0 2 abc
# print 0 2
# Sample Output 2
# xyz
# abc

#??\???
while 1:
	str = input()
	op_num = int( input() )
	# for i in range(op_num):
	# 	op = input().split()
	# 	a = int(op[1])
	# 	b = int(op[2])
		# if op[0]=="replace":
		# 	str = str.replace(str[ a:b+1 ], op[3])
		# elif op[0]=="reverse":
		# 	str = str.replace(str[a:b+1], str[ b-len(str) : a-len(str)-1 : -1 ] )
		# elif op[0]=="print":
		# 	print(str[a:b+1])

### FIXED CODE ###

# 21-String-Transformation.py

# ???????????????
# ????????? str ?????????????????????????????????????????????????????????????????°????????????????????????????????????
# ???????????\?????????????????????????????§??????

# print a b: str ??? a ??????????????? b ??????????????§??????????????????
# reverse a b: str ??? a ??????????????? b ??????????????§?????????????????????
# replace a b p: str ??? a ??????????????? b ??????????????§??? p ?????????????????????
# ????????§??????????????? str ????????????????????? 0 ???????????¨????????????

# Input
# 1 ?????????????????? str ????????????????????????str ?????±?°????????????????????????????
# 2 ????????????????????° q ?????????????????????????¶???? q ??????????????????????¨??????¢?????§?????????????????????

# Output
# ??? print ???????????¨???????????????????????????????????????????????????

# Constraints
# 1???str????????????1000
# 1???q???100
# 0???a???b<str?????????
# replace ????????§??? b???a+1=p?????????

# Sample Input 1
# abcde
# 3
# replace 1 3 xyz
# reverse 0 2
# print 1 4
# Sample Output 1
# xaze

# Sample Input 2
# xyz
# 3
# print 0 2
# replace 0 2 abc
# print 0 2
# Sample Output 2
# xyz
# abc

#??\???

str = input()
op_num = int( input() )
for i in range(op_num):
	op = input().split()
	a = int(op[1])
	b = int(op[2])
	if op[0]=="replace":
		# str = str.replace(str[ a:b+1 ], op[3])
		str = str[0:a] + op[3] + str[b+1:]
	elif op[0]=="reverse":
		# str = str.replace(str[a:b+1], str[ b-len(str) : a-len(str)-1 : -1 ] )
		str = str[:a] + str[a:b+1][::-1] + str[b+1:]
	# elif op[0]=="print":
	else:
		print(str[a:b+1])
N,A,B=map(int,input().split())
ballb=[]
ballr=[]
ballb.append('b')
ballb2=ballb*A
ballr.append('r')
ballr2=ballr*B
ball=(ballb2+ballr2)*(10**100)
count=0
for i in range(N):
    if ball[i]=='b':
        count += 1
print(count)


### FIXED CODE ###

N,A,B=map(int,input().split())
a=N//(A+B)*A
c=N%(A+B)
b=min(A,c)
print(a+b)
X=int(input())
tot=int(X/500)
y=X-tot*500
tot=tot*1000 + int(y/5)*5
print(tot)

### FIXED CODE ###

S=input()
if S[2]==S[3] and S[4]==S[5]:
    print('Yes')
else:
    print('No')
m,d = map(int,input().split())
ans = 0
if d < 10:
    print(ans)
else:
    for month in range(1,m+1):
        for day in range(1,d+1):
            if int(str(day)[0])*int(str(day)[1]) == month:
                if int(str(day)[1]) >= 2 and int(str(day)[0]) >= 2:
                    ans += 1
    print(ans)

### FIXED CODE ###

m,d = map(int,input().split())
ans = 0
if d < 10:
    print(ans)
else:
    for month in range(1,m+1):
        for day in range(10,d+1):
            if int(str(day)[0])*int(str(day)[1]) == month:
                if int(str(day)[1]) >= 2 and int(str(day)[0]) >= 2:
                    ans += 1
    print(ans)
# import itertools
# import math

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

ans_p = [0] * N
ans_s = [0] * N

for i in range(M):
    input_sp = input().split()
    P = int(input_sp[0]) - 1
    S = input_sp[1]

    if S == 'AC':
        ans_s[P] = 1
    elif S == 'WA' and ans_p[P] == 0:
        ans_p[P] += 1

for i in ans_p:
    if ans_s[i] == 0 and ans_p[i] != 0:
        ans_p[i] = 0


print(str(sum(ans_s)) + " " + str(sum(ans_p)))


### FIXED CODE ###

# import itertools
# import math

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

ans_p = [0] * N
ans_s = [0] * N

for i in range(M):
    input_sp = input().split()
    P = int(input_sp[0]) - 1
    S = input_sp[1]

    if S == 'AC':
        ans_s[P] = 1
    elif S == 'WA' and ans_s[P] == 0:
        ans_p[P] += 1

for i in range(len(ans_p)):
    if ans_s[i] == 0 and ans_p[i] != 0:
        ans_p[i] = 0

print(str(sum(ans_s)) + " " + str(sum(ans_p)))
N,T=map(int,input().split(' '))
times=[int(input()) for i in range(N)]
print(sum([min(T, times[i+1]-times[i] for i in range(N-1))])+times[-1])

### FIXED CODE ###

N,T=map(int,input().split(' '))
times=list(map(int,input().split(' ')))
print(sum([min(T, times[i+1]-times[i]) for i in range(N-1)])+T)
N = int(input())
A = list(map(int, input().split()))
B = []
C = 0
try:
    for i in range(N):
        if A[i] >= A[i + 1]:
            None
        else:
            B.append(A[C:i+1])
            C = i+1
except:
    if A[-2] >= A[-1]:
        B.append(A[C:])
    else:
        B.append(A[C:-1])
X = [len(B[j]) for j in range(len(B))]
print(max(X)-1)

### FIXED CODE ###

import sys
N = int(input())
A = list(map(int, input().split()))
B = []
C = 0
try:
    for i in range(N):
        if A[i] >= A[i + 1]:
            None
        else:
            B.append(A[C:i+1])
            C = i+1
except:
    try:
        if A[-2] >= A[-1]:
            B.append(A[C:])
        else:
            B.append(A[C:-1])
    except:
        print(0)
        sys.exit()
X = [len(B[j]) for j in range(len(B))]
print(max(X)-1)
import sys
import sympy

ans = 0
for i in range(1, int(input())+1):
    ans += 1 if i%2==1 and len(sympy.divisors(i)) == 8 else 0
print(ans)

### FIXED CODE ###

import sys

def div(n):
    count = 0
    for i in range(1, n+1):
        count += 1 if n%i==0 else 0
    return count

ans = 0
for i in range(1, int(input())+1):
    ans += 1 if i%2==1 and div(i) == 8 else 0
print(ans)
coin = {}
for _ in range(int(input())):
    x, u = input().split(' ')
    coin[u] = coin.get(u, 0) + float(x)

print(coin['JPY'] + coin['BTC'] * 380000)


### FIXED CODE ###

coin = {
    'JPY': 0,
    'BTC': 0
}
for _ in range(int(input())):
    x, u = input().split(' ')
    coin[u] += float(x)
print(coin['JPY'] + coin['BTC'] * 380000)
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = int(input())

aa = a[0]+a[1]*c
bb = b[0]+b[1]*c
d = aa-bb
e = a[1]-b[1]

if aa > bb:
  if d % e == 0:
    print("YES")
  else:
    print("NO")
elif aa == bb:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

s=input()
li = list(s)
a = li[0]+li[1]+li[2]
print(a)
import bisect


h, w, m = map(int, input().split())

count_h = [0 for i in range(h)]
count_w = [0 for i in range(w)]
points = set()
for i in range(m):
    y, x = map(int, input().split())
    y -= 1
    x -= 1
    points.add((y, x))
    count_h[y] += 1
    count_w[x] += 1

ch_max, cw_max = max(count_h), max(count_w)
ys = [y for y in range(len(count_h)) if count_h[y] == ch_max]
xs = [x for x in range(len(count_w)) if count_w[x] == cw_max]

ans = ch_max + cw_max
for (y, x) in points:
    index = bisect.bisect_left(ys, y)
    if ys[index] == y and xs[index] == x:
        ans -= 1
        break

print(ans)



### FIXED CODE ###

h, w, m = map(int, input().split())

count_h = [0 for i in range(h)]
count_w = [0 for i in range(w)]
points = set()
for i in range(m):
    y, x = map(int, input().split())
    y -= 1
    x -= 1
    points.add((y, x))
    count_h[y] += 1
    count_w[x] += 1

ch_max, cw_max = max(count_h), max(count_w)
ys = [y for y in range(len(count_h)) if count_h[y] == ch_max]
xs = [x for x in range(len(count_w)) if count_w[x] == cw_max]

    
ans = ch_max + cw_max
if len(ys) * len(xs) <= m:
    def _find():
        for x in xs:
            for y in ys:
                if (y, x) not in points:
                    return True
        return False
    if not _find():
        ans -= 1
print(ans)
N, K, *A = map(int, open(0).read().split())
MOD = 10 ** 9 + 7

z_num = sum(v == 0 for v in A)
p_num = sum(v > 0 for v in A)
m_num = sum(v < 0 for v in A)

if p_num + m_num < K:
    print(0)
    exit()
    
if m_num % 2 == 1 and p_num + m_num == K and z_num > 0:
    print(0)
    exit()
    
if p_num == 0 and m_num >= K and K % 2 == 1:
    if z_num > 0:
        print(0)
    else:
        x = sorted([v for v in A if v < 0], reversed=True)
        ans = 1
        n = len(x)
        for i in range(n - K, n):
            ans = ans * x[i] % MOD
        print(ans)
    exit()


x = sorted([(abs(v), v // abs(v)) for v in A if v != 0])
plus = []
minus = []
for i in range(K):
    v, s = x.pop()
    if s == 1:
        plus.append(v)
    else:
        minus.append(v)


if len(minus) % 2 != 0:
    p_cand = MOD
    m_cand = MOD
    while x:
        v, s = x.pop()
        if s == 1 and p_cand == MOD:
            p_cand = v
        elif s == -1 and m_cand == MOD:
            m_cand = v

    if p_cand == MOD and m_cand != MOD and plus:
        plus.pop()
        minus.append(m_cand)
    elif m_cand == MOD and p_cand != MOD and minus:
        minus.pop()
        plus.append(p_cand)
    elif p_cand != MOD and m_cand != MOD and plus and minus:
        p_org = plus.pop()
        m_org = minus.pop()
        if p_org * p_cand > m_org * m_cand:
            plus.append(p_org)
            plus.append(p_cand)
        else:
            minus.append(m_org)
            minus.append(m_cand)


ans = 1
for v in plus:
    ans = ans * v % MOD
for v in minus:
    ans = ans * (-v) % MOD
print(ans)


### FIXED CODE ###

N, K, *A = map(int, open(0).read().split())

MOD = 10 ** 9 + 7
s = []  # v >= 0
t = []  # v < 0
for i in range(N):
    if A[i] < 0:
        t.append(A[i])
    else:
        s.append(A[i])
        
ok = False  # ans > 0
if len(s) > 0:
    if N == K:
        ok = len(t) % 2 == 0
    else:
        ok = True
else:
    ok = K % 2 == 0

ans = 1
if not ok:
    x = sorted(A, key=lambda x: abs(x))
    for i in range(K):
        ans = ans * x[i] % MOD
else:
    s.sort()
    t.sort(key=lambda x: abs(x))
    if K % 2 == 1:
        ans = ans * s.pop() % MOD
        
    p = []
    while len(s) >= 2:
        x = s.pop() * s.pop()
        p.append(x)
    
    while len(t) >= 2:
        x = t.pop() * t.pop()
        p.append(x)

    p.sort(reverse=True)
    for i in range(K // 2):
        ans = ans * p[i] % MOD
    
print(ans)
C = []
for _ in range(3):
    c = list(map(int,input().split()))
    C.append(c)

if((C[1][1]-C[2][1]==C[1][2]-C[2][2])and(C[1][1]-C[2][1]==C[1][3]-C[2][3])
        and(C[1][1]-C[3][1]==C[1][2]-C[3][2])and(C[1][1]-C[3][1]==C[1][3]-C[3][3])
        and(C[1][1]-C[1][2]==C[2][1]-C[2][2])and(C[1][1]-C[1][2]==C[3][1]-C[3][2])
        and(C[1][1]-C[1][3]==C[2][1]-C[2][3])and(C[1][1]-C[1][3]==C[3][1]-C[3][3])):
    print("Yes")
else:  
    print("No")


### FIXED CODE ###

C = []
for _ in range(3):
    c = list(map(int,input().split()))
    C.append(c)

if((C[0][0]-C[1][0]==C[0][1]-C[1][1])and(C[0][0]-C[1][0]==C[0][2]-C[1][2])
        and(C[0][0]-C[2][0]==C[0][1]-C[2][1])and(C[0][0]-C[2][0]==C[0][2]-C[2][2])
        and(C[0][0]-C[0][1]==C[1][0]-C[1][1])and(C[0][0]-C[0][1]==C[2][0]-C[2][1])
        and(C[0][0]-C[0][2]==C[1][0]-C[1][2])and(C[0][0]-C[0][2]==C[2][0]-C[2][2])):
    print("Yes")
else:
    print("No")
s  = list(str(input()))
t  = list(str(input()))
s.sort()
t.sort()

for i in range(len(s)):
 
    if s[i] != t[i]:
 
        c1 = s[i]
        c2 = t[i]
 
        for j in range(len(s)):
            if s[j] == c1:
                s[j] = c2
            elif s[j] == c2:
                s[j] = c1

if "".join(s) == "".join(t) :
    print("Yes")        
else :
    print("No")

### FIXED CODE ###

l = list(map(int,input().split()))
l.sort(reverse=True)
print(l[0]*10+l[1]+l[2])
S=input()
for i in range(N-1):
  S=S[:-1]
  N=len(S)//2
  if S==S[:N]*2:
    print(N*2)
    exit()
print(1)

### FIXED CODE ###

S=input()
for i in range(len(S)-1):
  S=S[:-1]
  N=len(S)//2
  if S==S[:N]*2:
    print(N*2)
    exit()
print(1)
c11,c12,c13=map(str,input().split())
c21,c22,c23=map(str,input().split())
c31,c32,c33=map(str,input().split())
print(c11+c22+c33)


### FIXED CODE ###

a=str(input())
b=str(input())
c=str(input())
print(a[0]+b[1]+c[2])
import sys
sys.setrecursionlimit(2147483647)

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

def calc(k,i,j):
    c1 = 0
    c2 = 0
    global N,M,K,A,B
    if N-1>=i and A[i]+k <= K:
        c1 = 1+calc(A[i]+k,i+1,j)
    if M-1>=j and B[i]+k <= K:
        c2 = 1+calc(B[j]+k,i,j+1)
    return max(c1,c2)
count = calc(0,0,0)
print(count)



### FIXED CODE ###

import sys
sys.setrecursionlimit(2147483647)

N, M, K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
Asum = [0]
Bsum = [0]
count = 0
for p in A:
    count += p
    Asum.append(count)
count = 0
for p in B:
    count += p
    Bsum.append(count)
best = 0
Blast = M
for t in range(N+1):
    if Asum[t] > K:
        break
    if best < t:
        best=t
    for s in reversed(range(0,Blast+1)):
        if Asum[t]+Bsum[s]<=K:
            if best < t+s:
                best=t+s
            Blast = s
            break
print(best)
s = set(input())
ans = True
for i in range(3):
    ans = ans and (s[i] != s[i+1])
if ans: print('Good')
else: print('Bad')

### FIXED CODE ###

s = input()
ans = True
for i in range(3):
    ans = ans and (s[i] != s[i+1])
if ans: print('Good')
else: print('Bad')
H,W,N = map(int,input().split())
dic={}
for _ in range(N):
  a,b = [int(x)-1 for x in input().split()]
  for h in range(a-2,a+3):
    for w in range(b-2,b+3):
      if 0<=h<H and 0<=w<W:
        dic[10**10*h+w] = dic.get(10**10*h+w,0)+1
ans = [0]*10
for x in dic.values():
  ans[x] += 1
ans[0] = (H-2)*(W-2)-sum(ans[1:])
for x in ans:
  print(x)
        


### FIXED CODE ###

H,W,N = map(int,input().split())
dic={}
for _ in range(N):
  a,b = [int(x)-1 for x in input().split()]
  for h in range(a,a+3):
    for w in range(b,b+3):
      if 0<=h-2 and h<H and 0<=w-2 and w<W:
        dic[10**10*h+w] = dic.get(10**10*h+w,0)+1
ans = [0]*10
for x in dic.values():
  ans[x] += 1
ans[0] = (H-2)*(W-2)-sum(ans[1:])
for x in ans:
  print(x)
n,m = map(int,input().split())
for i in range(n,10000000000000000):
    if m%i == 0:
        n=i
        break
print(int(m/i))

### FIXED CODE ###

n = int(input())
for i in range(n-1):
    a = int(input())
    b = int(input())
if n == 1:
    print('Hello World')
else:
    print(a+b)
n,k = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort(reverse=True)

def isOk(x):
    cost = 0
    for a, f in zip(A,F):
        eatable = x//f
        if eatable >= a:
            continue
        cost += a - eatable
    if cost <= k:
        return True
    return False

left = -1
right = A[-1] * F[0]
while left+1 < right:
    mid = int(left + (right-left)//2)
    if isOk(mid):
        right = mid
    else:
        left = mid
print(right)n,k = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort(reverse=True)

def isOk(x):
    cost = 0
    for a, f in zip(A,F):
        eatable = x//f
        if eatable >= a:
            continue
        cost += a - eatable
    if cost <= k:
        return True
    return False

left = -1
right = A[-1] * F[0]
while left+1 < right:
    mid = int(left + (right-left)//2)
    if isOk(mid):
        right = mid
    else:
        left = mid
print(right)

### FIXED CODE ###

n,k = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort(reverse=True)

def isOk(x):
    cost = 0
    for a, f in zip(A,F):
        eatable = x//f
        if eatable >= a:
            continue
        cost += a - eatable
    if cost <= k:
        return True
    return False

left = -1
right = A[-1] * F[0]
while left+1 < right:
    # mid = int(left + (right-left)//2)
    mid = (left+right)//2
    if isOk(mid):
        right = mid
    else:
        left = mid
print(right)