Harryxun/stf_run huggingface dataset:
import sys
input = sys.stdin.readlin
INF = float('INF')


def main():
    H, N = map(int, input().split())
    skills = [None] * N
    max_a = 0
    for i in range(N):
        a, b = map(int, input().split())
        if a > max_a:
            max_a = a
        skills[i] = (a, b)

    # dpの配列準備
    # インデックス→体力、中身→その体力を削るための最小MP
    dp = [INF] * (H + max_a + 1111
    dp[0]=0


    # 各体力を削る最小MPをDPで更新していく
    for i in range(H):
        # そのHPをちょうど削る攻撃がない場合はそれ以降の行動を計算できないので飛ばす1
        if dp[i] == INF:
            continue

        # そうでない場合は、次の攻撃をシミュレーション
        for a, b in skills:
            # 攻撃した場合の累計消費MPを算出
            mp=dp[i] + b
            # その攻撃をした場合に削れる体力に割り当てられている消費MPと比較
            # より少ない消費MPで削れることがわかった場合は更新
            if mp < dp[i + a]:
                dp[i + a]=mp

    # 更新が終わったので、倒せるダメージのうち、累計消費MPが一番少ないものを出力
    print(min(dp[H:]))


 if __name__ == "__main__":
     main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
INF = float('INF')


def main():
    H, N = map(int, input().split())
    skills = [None] * N
    max_a = 0
    for i in range(N):
        a, b = map(int, input().split())
        if a > max_a:
            max_a = a
        skills[i] = (a, b)

    # dpの配列準備
    # インデックス→体力、中身→その体力を削るための最小MP
    dp = [INF] * (H + max_a + 1)
    dp[0] = 0

    # 各体力を削る最小MPをDPで更新していく
    for i in range(H):
        # そのHPをちょうど削る攻撃がない場合はそれ以降の行動を計算できないので飛ばす1
        if dp[i] == INF:
            continue

        # そうでない場合は、次の攻撃をシミュレーション
        for a, b in skills:
            # 攻撃した場合の累計消費MPを算出
            mp = dp[i] + b
            # その攻撃をした場合に削れる体力に割り当てられている消費MPと比較
            # より少ない消費MPで削れることがわかった場合は更新
            if mp < dp[i + a]:
                dp[i + a] = mp

    # 更新が終わったので、倒せるダメージのうち、累計消費MPが一番少ないものを出力
    print(min(dp[H:]))

if __name__ == "__main__":
    main()
import math

n = int(input())
for i in reversed(range(math.ceil(n**0.5))):
    if n%i==0:
        print(max(len(str(i)), len(str(n//i))))
        exit()


### FIXED CODE ###

n = int(input())
for i in reversed(range(int(n**0.5)+1)):
    if n%i==0:
        print(max(len(str(i)), len(str(n//i))))
        exit()
N = int(input())
F= [list(map(int, input().split())) for _ in range(N)]
P= [list(map(int, input().split())) for _ in range(N)]

num = 0
store = []
second = []
pos = []
ans = 0
min_z = 10**7+1
n = 0
for i in range(N):
    num = F[i].count(1)
    if(max(P[i][:(num+1)]) != P[i][0]):
        ans += max(P[i][:(num+1)])
    else:
        store.append(P[i][0])
        second.append(max(P[i][1:(num+1)]))
        pos.append(i)
if ans:
    for j in pos:
        ans += store[j]
    print(ans)
else:
    for k in range(len(pos)):
        if(store[k]-second[k] < min_z):
            min_z = store[k]-second[k]
            n = k
    ans += second[n]
    for k in range(len(store)):
        if(k == n):
            continue
        ans += store[k]
    print(ans)

### FIXED CODE ###

N = int(input())
F= [list(map(int, input().split())) for _ in range(N)]
P= [list(map(int, input().split())) for _ in range(N)]

ans = -10000000000
for mask in range(1, 2**10):
    tmp = 0
    for j in range(N):
        cnt = 0
        for k in range(10):
            if((mask>>k)%2 == 1 and F[j][k] == 1):
                cnt += 1
        tmp += P[j][cnt]
    ans = max(ans, tmp)

print(ans)
info_A = input().split()
info_B = input().split()
T = int(input())
win = ''

A = int(info_A[0]) #A（鬼）の開始位置
V = int(info_A[1]) #A（鬼）の速度
B = int(info_B[0]) #B（逃げる側）の開始位置
W = int(info_B[1]) #B（逃げる側）の速度

# 逃げる側の速度が同じか速ければ追いつけない
if W >= V:
    win = 'B'

else:
# T秒後までに同じ座標にいればAが勝つ
    k = (B-A)/(V-W)
    if k <= T and 0 < k and (k*10)%10 == 0
        win = 'A'

if win == 'A':
    print('YES')
else:
    print('NO')

### FIXED CODE ###

info_A = input().split()
info_B = input().split()
T = int(input())
win = ''

A = int(info_A[0]) #A（鬼）の開始位置
V = int(info_A[1]) #A（鬼）の速度
B = int(info_B[0]) #B（逃げる側）の開始位置
W = int(info_B[1]) #B（逃げる側）の速度

# 逃げる側の速度が同じか速ければ追いつけない
if W >= V:
    win = 'B'

else:
# T秒後までに同じ座標にいればAが勝つ
    k = (B-A)/(V-W)
    if A>B:
        k = -k
    
    if k <= T and 0 < k:
        win = 'A'
    else:
        win = 'B'


if win == 'A':
    print('YES')
else:
    print('NO')
print(int(input())+int(input())if input()=='1'else"Hello World")

### FIXED CODE ###

print(int(input())+int(input())if input()=='2' else "Hello World")
N = list(input())
print('Yes' if N[1] == N[2] and (N[0] == N[1] or N[2] == N[3]) else 'No')a

### FIXED CODE ###

N = list(input())
print('Yes' if N[1] == N[2] and (N[0] == N[1] or N[2] == N[3]) else 'No')
N=int(input())
A=list(map(int, input().split()))
ans=[0]*N
for _i in range(N):
  ans[A[i]-1]+=1

for x in ans:
  print(x)

### FIXED CODE ###

N=int(input())
A=list(map(int, input().split()))
ans=[0]*N

for i in range(N-1):
  ans[A[i]-1]+=1
 
for x in ans:
  print(x)
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

satisfaction=0

for i in range(N):
    if  i>=1:
        if  A[i-1]+1==A[i]:
            satisfaction+=(C[A[i]-1]+B[A[i]-1])
 
        else:
            satisfaction+=B[i]

print(satisfaction)

### FIXED CODE ###

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

satisfaction=0

for i in range(N):
  satisfaction+=B[A[i]-1]
    
  if  i<=N-2:
      if  A[i]+1==A[i+1]:
          satisfaction+=C[A[i]-1] 
  else:
      pass

print(satisfaction)
import math
a, b, c, d = map(int, input().split())

#
c_d = c * d / math.gcd(c, d)

def check(cc):
    if a%cc == 0:
        tmp_a = a
    else:
        tmp_a = cc*(a//cc+1)
    if b%cc == 0:
        tmp_b = b
    else:
        tmp_b = cc*(b//cc)

    #print('a, b')
    #print(tmp_a, tmp_b)
    if tmp_a > b:
        return 0
    elif tmp_b < a:
        return 0
    tmp = tmp_b-tmp_a

    return (tmp // cc) + 1

# c
tmp_1 = check(c)
#d
tmp_2 = check(d)

tmp_3 = check(c_d)


#print(tmp_1, tmp_2, tmp_3)


print(int((b-a)-(tmp_1+tmp_2-tmp_3*2)))


### FIXED CODE ###

import fractions

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

c_d = (c * d) // fractions.gcd(c, d)

a -= 1

tmp_b = b - (b//c + b//d - b//c_d)
tmp_a = a - (a//c + a//d - a//c_d)

print(tmp_b-tmp_a)
N, M, Q = map( int, input().split())
NN = [ [0]*N for _ in range(N)]
for _ in range(M):
    L, R = map( int, input().split())
    NN[L-1][R-1] += 1

for i in range(1,N+1):
    for j in range(1,N+1):
        NN[i][j] += NN[i][j-1]+NN[i-1][j]+NN[i-1][j]-NN[i-1][j-1]
for _ in range(Q):
    p, q = map( int, input().split())
    print(NN[p-1][q-1])

### FIXED CODE ###

N, M, Q = map( int, input().split())
NN = [ [0 for _ in range(N+1)] for _ in range(N+1)]
for _ in range(M):
    L, R = map( int, input().split())
    NN[L][R] += 1

for i in range(1,N+1):
    for j in range(1,N+1):
        NN[i][j] += NN[i][j-1]+NN[i-1][j]-NN[i-1][j-1]
for _ in range(Q):
    p, q = map( int, input().split())
    print(NN[q][q]-NN[q][p-1]-NN[p-1][q]+NN[p-1][p-1])
,D=map(int,input().split())
X=[]
Y=[]
for i in range(N):
    x,y=map(int,input().split())
    X.append(x)
    Y.append(y)
ans=0    
for i in range(N):
    if X[i]**2+Y[i]**2 <= D**2:
        ans += 1

print(ans)


### FIXED CODE ###

N,D=map(int,input().split())
X=[]
Y=[]
for i in range(N):
    x,y=map(int,input().split())
    X.append(x)
    Y.append(y)
ans=0    
for i in range(N):
    if X[i]**2+Y[i]**2 <= D**2:
        ans += 1

print(ans)
from collections import Counter as co
s=input()
n=len(s)
l=sorted(co(list(s)).values())
if len(l)<=2:
    print("YES") if n==len(l) else print("NO")

else:
    m=l[0]
    for i,v in l:
        if v-m<=1:continue
        print("NO");exit()

    print("YES")

### FIXED CODE ###

from collections import Counter as co
s=input()
n=len(s)
l=sorted(co(list(s)).values())
if len(l)<=2:
    print("YES") if n==len(l) else print("NO")

else:
    m=l[0]
    for v in l:
        if v-m<=1:continue
        print("NO");exit()

    print("YES")
import sys

argvs = sys.argv

x = int(argvs[1])
print str(x**3)

### FIXED CODE ###

import sys

argvs = sys.argv

for x in sys.stdin:
    print str(int(x)**3)
S=input()
T=input()
print(sum(s==t for s,t in zip(s,t)))

### FIXED CODE ###

S=input()
T=input()
print(sum(s==t for s,t in zip(S,T)))
import math

return int(input())*2*math.pi


### FIXED CODE ###

import math

print(int(input())*2*math.pi)
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from collections import Counter
from itertools import product
from math import factorial

# prime numbers
primes = list(range(int(10**9 ** 0.5) + 1))
primes[1] = 0
for i in range(2, int(len(primes) ** 0.5) + 1):
    if primes[i]:
        for j in range(2 * i, len(primes), i):
            primes[j] = 0

def main():
    N, M = LI()
    # 素因数分解
    factors = Counter()
    for i in range(int(M ** 0.5) + 1):
        if primes[i]:
            while M % i == 0:
                factors[i] += 1
                M //= i
        if M < i:
            break
    if M != 1:
        factors[M] += 1
    ans = 1
    for k in factors.values():
        a, b = 1, 1
        for i in range(1, k + 1):
            a *= N + k - i
            b *= i
        ans = (ans * (a // b)) % MOD

    return ans % MOD

print(main())

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from collections import Counter
from itertools import product
from math import factorial

# prime numbers
primes = list(range(int(10**5) + 1))
primes[1] = 0
for i in range(2, int(len(primes) ** 0.5) + 1):
    if primes[i]:
        for j in range(2 * i, len(primes), i):
            primes[j] = 0

def main():
    N, M = LI()
    # 素因数分解
    factors = Counter()
    for i in range(int(M ** 0.5) + 1):
        if primes[i]:
            while M % i == 0:
                factors[i] += 1
                M //= i
        if M < i:
            break
    if M != 1:
        factors[M] += 1
    ans = 1
    for k in factors.values():
        a, b = 1, 1
        for i in range(1, k + 1):
            a *= N + k - i
            b *= i
        ans = (ans * (a // b)) % MOD

    return ans % MOD

print(main())
num = input()
str_list = input.split(" ")
 
yes = True

for index, s in enumerate(str_list):
	if s in str_list[:index]:
		yes = False
		break
if yes:
	print("YES")
else:
	print("NO")

### FIXED CODE ###

num = input()
str_list = input().split(" ")
 
yes = True
num_dict = {}
for s in str_list:
	if s in num_dict:
		yes = False
		break
	else:
		num_dict[s] = 1
if yes:
	print("YES")
else:
	print("NO")
n = int(input().split())
if n[0]==n[2]: print('Yes')
else: print('No')

### FIXED CODE ###

n = list(map(int,input()))
if n[0]==n[2]: print('Yes')
else: print('No')
import sys
from collections import deque

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
    h, w, k = nm()
    sy, sx, gy, gx = nm()
    d = [(0, 1), (1, 0), (-1, 0), (0, -1)]
    sx -= 1; sy -= 1
    gx -= 1; gy -= 1
    C = [ns() for _ in range(w)]
    G = [[[10**10]*w for _ in range(h)] for i in range(4)]
    for i in range(4):
        G[i][sy][sx] = 0
    q = deque([(sy, sx, i, 0) for i in range(4)])
    while q:
        y, x, t, c = q.popleft()
        if c:
            dy, dx = d[t]
            ny = y + dy; nx = x + dx
            if 0 <= ny < h and 0 <= nx < w and C[ny][nx] != '@' and G[t][ny][nx] > G[t][y][x]:
                G[t][ny][nx] = G[t][y][x]
                q.appendleft((ny, nx, t, c-1))
        for i in range(4):
            dy, dx = d[i]
            ny = y + dy; nx = x + dx
            if 0 <= ny < h and 0 <= nx < w and C[ny][nx] != '@' and G[i][ny][nx] > G[t][y][x] + 1:
                G[i][ny][nx] = G[t][y][x] + 1
                q.append((ny, nx, i, k-1))
    ans = min(G[i][gy][gx] for i in range(4))
    print(ans if ans < 10**10 else -1)
    return

solve()


### FIXED CODE ###

import sys
from collections import deque

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))


def solve():
    h, w, k = nm()
    sy, sx, gy, gx = nm()
    d = [(0, 1), (1, 0), (-1, 0), (0, -1)]
    sx -= 1; sy -= 1
    gx -= 1; gy -= 1
    C = [ns() for _ in range(h)]
    G = [[10**7]*w for _ in range(h)]
    G[sy][sx] = 0
    q = deque([(sy, sx)])
    while q:
        y, x = q.popleft()
        for i in range(4):
            dy, dx = d[i]
            ny, nx = y, x
            for _ in range(k):
                ny += dy; nx += dx
                if ny < 0 or h <= ny or nx < 0 or w <= nx:
                    break
                if C[ny][nx] == '@' or G[ny][nx] <= G[y][x]:
                    break
                if G[ny][nx] > G[y][x] + 1:
                    G[ny][nx] = G[y][x] + 1
                    q.append((ny, nx))
    ans = G[gy][gx]
    print(ans if ans < 10**7 else -1)
    return

solve()
import math

def lcm(a, b):
    return (a * b) // math.gcd(a,  b)

def lcm_list(li):
    if len(li) == 2:
        return lcm(li[0], li[1])
    else:
        li = [lcm(li[0], li[1])] + li[2:]
        return  lcm_list(li)

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


i = lcm_list(a) -1
print(sum([i%j for j in a]))

### FIXED CODE ###

import sys
sys.setrecursionlimit(30000)

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

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

def lcm_list(li):
    if len(li) == 2:
        return lcm(li[0], li[1])

    else:
        li = [lcm(li[0], li[1])] + li[2:]
        return lcm_list(li)

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


i = max(lcm_list(a) - 1, 1)
print(sum([i % j for j in a]))
A,B = int(input())
if A<=9:
  if B<=9:
    print(A*B)
  else:
    print(-1)
else:
  print(-1)

### FIXED CODE ###

A,B = map(int, input().split())
if A<=9:
  if B<=9:
    print(A*B)
  else:
    print(-1)
else:
  print(-1)
import math

a,b = (int(x) for x in input().split())
amin = math.ceil(float(a/0.08))
amax = math.floor(float((a+1)/0.08))
bmin = math.ceil(float(b/0.1))
bmax = math.floor(float((b+1)/0.1))

if amax < bmin or bmax < amin:
  print(-1)
else:
  la = list(range(amin,amax))
  lb = list(range(bmin,bmax))
  print(min(set(la) & set(lb)))

### FIXED CODE ###

import math

a,b = (int(x) for x in input().split())
if (a*100)%8 == 0:
  amin = int(a/0.08)
else:
  amin = math.ceil(a/0.08)
if ((a+1)*100)%8 == 0:
  amax = int((a+1)/0.08)-1
else:
  amax = math.floor((a+1)/0.08)

if (b*100)%10 == 0:
  bmin = int(b/0.1)
else:
  bmin = math.ceil(b/0.1)
if ((b+1)*100)%10 == 0:
  bmax = int((b+1)/0.1)-1
else:
  bmax = math.floor((b+1)/0.1)
  
if amax < bmin or bmax < amin:
  print(-1)
else:
  la = list(range(amin,amax))
  lb = list(range(bmin,bmax))
  print(min(set(la) & set(lb)))
n,k,q=map(int,input().split())
ans=[-q]*n
for i in range(q):
  a=int(input())
  ans[a]+=1
print(sum(x > -k for x in ans))
  

### FIXED CODE ###

n,k,q=map(int,input().split())
ans=[-q]*n
for i in range(q):
  a=int(input())
  ans[a-1]+=1
  
for i in range(n):
  print('Yes' if ans[i] > -k else 'No')
mod = 10**9+7
fact = [1]*(2*10**5+1)
for n in range(1,2*10**5+1):
    fact[n] = n*fact[n-1]%mod
factinv = [1]*(2*10**5+1)
inv = [1]*(2*10**5+1)
for n in range(1,2*10**5+1):
    factinv[n] = pow(fact[n],mod-2,mod)
    inv[n] = pow(n,mod-2,mod)
def comb(n,k):
    return fact[n]*factinv[k]*factinv[n-k]%mod

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

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

p = [-1]*N
p[0] = 0
q = [0]
while q:
    i = q.pop()
    for j in g[i]:
        if p[j]==-1:
            p[j] = i
            q.append(j)

c = [[] for _ in range(N)]
for i in range(1,N):
    c[p[i]].append(i)

cn = [-1]*N
def rec(n):
    if cn[n] != -1:
        return cn[n]
    res = 0
    for i in c[n]:
        res += rec(i)+1
    cn[n] = res
    return res

cn[0] = rec(0)    

ans = [0]*N

def dfs(n):
    res = fact[cn[n]]
    for c in g[n]:
        if c==p[n]:
            continue
        res *= factinv[cn[c]+1]*dfs(c)
        res %= mod
    return res

ans[0] = dfs(0)

q = [0]
while q:
    i = q.pop()
    for j in g[i]:
        if ans[j]==0:
            ans[j] = ans[i]*(cn[j]+1)*inv[N-1-cn[j]]%mod
            q.append(j)

for i in range(N):
    print(ans[i])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
mod = 10**9+7
fact = [1]*(2*10**5+1)
for n in range(1,2*10**5+1):
    fact[n] = n*fact[n-1]%mod
factinv = [1]*(2*10**5+1)
inv = [1]*(2*10**5+1)
for n in range(1,2*10**5+1):
    factinv[n] = pow(fact[n],mod-2,mod)
    inv[n] = pow(n,mod-2,mod)
def comb(n,k):
    return fact[n]*factinv[k]*factinv[n-k]%mod

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

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

p = [-1]*N
p[0] = 0
q = [0]
while q:
    i = q.pop()
    for j in g[i]:
        if p[j]==-1:
            p[j] = i
            q.append(j)

c = [[] for _ in range(N)]
for i in range(1,N):
    c[p[i]].append(i)

cn = [-1]*N
def rec(n):
    if cn[n] != -1:
        return cn[n]
    res = 0
    for i in c[n]:
        res += rec(i)+1
    cn[n] = res
    return res

cn[0] = rec(0)    

ans = [0]*N

def dfs(n):
    res = fact[cn[n]]
    for c in g[n]:
        if c==p[n]:
            continue
        res *= factinv[cn[c]+1]*dfs(c)
        res %= mod
    return res

ans[0] = dfs(0)

q = [0]
while q:
    i = q.pop()
    for j in g[i]:
        if ans[j]==0:
            ans[j] = ans[i]*(cn[j]+1)*inv[N-1-cn[j]]%mod
            q.append(j)

for i in range(N):
    print(ans[i])
s = str(input())
s_list = []
for i in range(len(s)):
  s_list.append(s[i])

#print(s_list)
L = len(s_list)

sum_a = 0
for k in range(2**(L-1)):
  plus_list = [0]*(L-1)
  p = list(bin(k)[2:])
  for l in range(len(p)):
    plus_list[L-len(p)+l-1] = int(p[l])
  
  #print("p_list:",plus_list)
  #print("p:",p)
  num_list = []
  start = 0
  for i in range(len(plus_list)):
    if plus_list[i]:
      num_list.append(s_list[start:i+1])
      start = i+1
  num_list.append(s_list[start:])
  ans = 0
  for i in num_list:
    s = ''
    for j in i:
      s = s+j
    ans += int(s)
  sum_a += ans
  #print("num_list:",num_list)
  #print("ans:",ans)
print(sum_a)

### FIXED CODE ###

s = str(input())
s_list = []
for i in range(len(s)):
  s_list.append(s[i])

#print(s_list)
L = len(s_list)

sum_a = 0
if L == 1:
  print(int(s))
else:
  for k in range(2**(L-1)):
    plus_list = [0]*(L-1)
    p = list(bin(k)[2:])
    for l in range(len(p)):
      plus_list[L-len(p)+l-1] = int(p[l])

    #print("p_list:",plus_list)
    #print("p:",p)
    num_list = []
    start = 0
    for i in range(len(plus_list)):
      if plus_list[i]:
        num_list.append(s_list[start:i+1])
        start = i+1
    num_list.append(s_list[start:])
    ans = 0
    for i in num_list:
      s = ''
      for j in i:
        s = s+j
      ans += int(s)
    sum_a += ans
    #print("num_list:",num_list)
    #print("ans:",ans)
  print(sum_a)
A, B, C = int(input().split())

int D = max(A, B, C)

if A == D :
  print(A * 10 + B + c)
  
elif B == D:
  print(B * 10 + A + C)
  
elif C == D
  print(C * 10 + A + B)

### FIXED CODE ###

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


ans = max(A*10 + B + C, B*10 + A + C, C*10 + A + B)
print(ans)
n=input()
b=list(map(int , input().slice()))
c=1
for i in range(1,n):
  c=c*b[i]
  if c>10**18:
    print(-1)
  
print(c)

### FIXED CODE ###

n=int(input())
a=list(map(int, input().split( )))
if 0 in a:
  print(0)
  
else:
    c=1
    for i in a:
        c= c*i
        if c> 10**18:
            c=-1
            break
    print(c)
N = int(input())

x_list=[]
y_list=[]
h_list=[]

def all_same(items):
	return all(map(lambda x: x == items[0], items))

for i in range(N):
	x,y,h=map(int, input().split())
	x_list.append(x)
	y_list.append(y)
	h_list.append(h)	
		
for cy in range(N+1):
	for cx in range(N+1):
		H_list = []
		for i in range(N):
			if h_list[i] != 0:
				H = abs(cx - x_list[i])+abs(cy - y_list[i])+h
				H_list.append(H) 
			if h_list[i] == 0:
				H = abs(cx - x_list[i])+abs(cy - y_list[i])+h
				if H > 0:
					break
		if all_same(H_list):
			print(str(cx)+' '+str(cy)+' '+str(H_list[0]))
			break

### FIXED CODE ###

N = int(input())

x_list=[]
y_list=[]
h_list=[]


def all_same(items):
	return all(map(lambda x: x == items[0], items))

for i in range(N):
	x,y,h=map(int, input().split())
	x_list.append(x)
	y_list.append(y)
	h_list.append(h)
		
for cy in range(101):
	for cx in range(101):
		n = -1	
		for h in h_list:
			n += 1
			if h >= 1:
				H = abs(cx - x_list[n])+abs(cy - y_list[n])+h
				h_now_list=[]
				break
		for i in range(N):
			h_now = max((H-abs(cx - x_list[i])-abs(cy - y_list[i])), 0)
			h_now_list.append(h_now)
			if h_now != h_list[i]:
				break	
			else:
				if len(h_now_list)==N:
					print(str(cx)+' '+str(cy)+' '+str(H))
					break
	else:
		continue
	break
A = list(int(input()))

for i in range(2**3):
  tmp=A[:]
  for j in range(3):
    if (i>>j)&1:
      tmp[j]*=-1
  if sum(A) == 7:
    for s in tmp:
      print(s,end="")
    print("=7")

### FIXED CODE ###

A = list(input())

for i in range(2**3):
  tmp=A[:]
  for j in range(3):
    if (i>>j)&1:
      tmp[j]+="-"
    else:
      tmp[j]+="+"
  if eval("".join(tmp)) == 7:
    tmp[-1]+="=7"
    for s in tmp:
      print(s,end="")
    exit()