Harryxun/stf_run huggingface dataset:
import math
a,b,x = map(int,input().split())

all_v = a*a*b
#h = x/(a*a)

if all_v/2 >= x:
    print(90-math.degrees(math.atan(2*x/(a*b*b))))
else:
    print(90-math.degrees(math.atan(a*a*a/(2*(a*a*b-x)))))

### FIXED CODE ###

import math
a,b,x = map(int,input().split())

all_v = a*a*b

if all_v == x:
    print(0)
elif all_v/2 >= x:
    print(90-math.degrees(math.atan(2*x/(a*b*b))))
else:
    print(90-math.degrees(math.atan(a*a*a/(2*(a*a*b-x)))))
n=int(input())
v=list(map(int,input().split()))
 
k=n//2
even=range(0,2*k,2)
odd=range(1,2*k+1,2)
 
el=[]
for i in even:
    el.append(v[i])
ol=[]
for i in odd:
    ol.append(v[i])
 
d={}
for i in el:
    if((i in d)is False ):
        d[i]=0
    else:
        d[i]+=1
e = max(d, key=d.get)
 
d={}
for i in ol:
    if((i in d)is False ):
        d[i]=0
    else:
        d[i]+=1
o = max(d, key=d.get)
 
if(el==ol):
    print(k)
else:
    sum=0
    for i in el:
        if(i!=e):
            sum+=1
    for i in ol:
        if(i!=o):
            sum+=1
    print(sum)

### FIXED CODE ###

N=input()
a=[]
for i in range(3):
    if(N[i]=="1"):
        a.append("9")
    elif(N[i]=="9"):
        a.append("1")
    else:
        a.append(N[i])
print("".join(a))
print("Yes")
n = int(input())
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort(key= lambda x:x[1])
time = 0
for i in ab:
    time += i[0]
    if time <= i[1]:
        continue
    else:
        print("No")
        sys.exit()
print("Yes")

### FIXED CODE ###

import sys
n = int(input())
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort(key= lambda x:x[1])
time = 0
for i in ab:
    time += i[0]
    if time <= i[1]:
        continue
    else:
        print("No")
        sys.exit()
print("Yes")
n,a=map(int,input().split())

l=[a+i-1 for i in range(1,n+1)]

import numpy as np
b=min(np.abs(l))

if b==0:
  l.remove(0)
else:
  l.remove([b,-b])
  
print(sum(l))

### FIXED CODE ###

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

l=[a+i-1 for i in range(1,n+1)]

import numpy as np
b=min(np.abs(l))

if b==0:
  l.remove(0)
elif b in l:
  l.remove(b)
elif -b in l:
  l.remove(-b)
  
print(sum(l))
n, *ps = map(int, open(0).read().split())
cou =0
for x, y, z in zip(ps[:-2], ps[1:-1], ps[2:]):
  if (x-y)*(z-y)<0:
    cou += 1
print(cou)

### FIXED CODE ###

S = [s for s in input()]
S.sort()
if (S[0]==S[1]) and (S[1]!=S[2]) and (S[2]==S[3]):
  print('Yes')
else:
  print('No')
N=int(input())
H=list(map(int,input().split()))
ans=[]

def compare(list,i,holder=0):
	if i==N-1:
		return holder
	if list[i]>=list[i+1]:
		compare(list,i+1,holder+1)
	else:
		return holder

def main(list,i=0):
	holder=compare(list,i)
	ans.append(holder)
	if i+holder<=N-1:
		main(list,i+holder)
main(H)
print(ans.max) 
		


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

N=int(input())
H=list(map(int,input().split()))
ans=[]

def compare(list,i,holder=0):
	if i==N-1:
		ans.append(holder)
		return holder
	if list[i]>=list[i+1]:
		return compare(list,i+1,holder+1)
	else:
		ans.append(holder)
		return compare(list,i+1)						

compare(H,0)
print(max(ans))
n = int(intput())

res = n // 2
if res % 2 == 1:
  res += 1
  
print(res)

### FIXED CODE ###

n = int(input())
res = n // 2
if n % 2 == 1:
  res += 1
print(res)
K,N = map(int,input().split())
A_list = list(map(int,input().split())
A_list.append(K+A_list[0])
A_split = []
i for in range(N):
    split = A_list[i+1] - A_list[i]
    A_split.append(split)

A_split.pop(A_split.index(max(A_split)))
print(sum(A_split))

### FIXED CODE ###

K,N = map(int,input().split())
A_list = list(map(int,input().split()))
A_list.append(K + A_list[0])
A_split = []
for i in range(N):
    A_split.append(A_list[i+1]-A_list[i])

A_split.pop(A_split.index(max(A_split)))
print(sum(A_split))
N, M = map(int, input().split())
mod = 10 ** 9 + 7


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append((i, cnt))

    if temp!=1:
        arr.append((temp, 1))

    if arr==[]:
        arr.append((n, 1))

    return arr


fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]


def cmb(n, r):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n - r] % mod


for i in range(2, 2 * N + 1):
    fact.append((fact[-1] * i) % mod)
    inv.append((-inv[mod % i] * (mod // i)) % mod)
    factinv.append((factinv[-1] * inv[-1]) % mod)


A = factorization(M)
ans = 1

for (key, value) in A:
    ans *= cmb(value + N - 1, value)
    ans %= mod

print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
mod = 10 ** 9 + 7
m = 0


def factorization(n):
    if n == 1:
        return []
    arr = []
    temp = n
    global m
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append((i, cnt))
            m = max(m, cnt)

    if temp!=1:
        arr.append((temp, 1))

    if arr==[]:
        arr.append((n, 1))

    return arr


fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]


def cmb(n, r):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n - r] % mod


for i in range(2, 2 * N + 2 * m + 10):
    fact.append((fact[-1] * i) % mod)
    inv.append((-inv[mod % i] * (mod // i)) % mod)
    factinv.append((factinv[-1] * inv[-1]) % mod)


A = factorization(M)
ans = 1

for (key, value) in A:
    ans *= cmb(value + N - 1, value)
    ans %= mod

print(ans)
# coding: utf-8
# Your code here!
N=int(input())
X=list(input())

ones=X.count("1")
high=ones+1
low=ones-1

mod_h=[1]
mod_l=[1]
for i in range(N-1):
    mod_h.append((mod_h[-1]*2)%high)
    mod_l.append((mod_l[-1]*2)%low)

mod_h=mod_h[::-1]
mod_l=mod_l[::-1]

for i in range(N):
    ans=0
    if X[i]=="0":
        #high_root
        temp=X[:]
        temp[i]="1"
        for j in range(len(temp)):
            if temp[j] == "1":
                ans+=mod_h[j]
        ans%=high
    else:
        temp=X[:]
        temp[i]="0"
        for j in range(len(temp)):
            if temp[j] == "1":
                ans+=mod_l[j]
        ans%=low
    """
    count=1
    while ans!=0:
        ans=ans%(bin(ans).count("1"))
        count+=1
    """
    print(count)
    
    

### FIXED CODE ###

# coding: utf-8
# Your code here!
N=int(input())
X=list(input())

ones=X.count("1")
high=ones+1
low=ones-1

mod_h=[1]
mod_l=[1]
for i in range(N-1):
    mod_h.append((mod_h[-1]*2)%high)
    mod_l.append((mod_l[-1]*2)%low if low!=0 else 0) 

mod_h=mod_h[::-1]
mod_l=mod_l[::-1]

ans_high=0
for i in range(N):
    if X[i] == "1":
        ans_high+=mod_h[i]
ans_high%=high

ans_low=0
for i in range(N):
    if X[i] == "1":
        ans_low+=mod_l[i]
ans_low%=low if low!=0 else 1
        
for i in range(N):
    if X[i]=="0":
        ans=ans_high
        ans+=mod_h[i]
        ans%=high
    else:
        if low==0:
            print(0)
            continue
        ans=ans_low
        ans-=mod_l[i]
        ans%=low
    
    count=1
    while ans!=0:
        ans=ans%(bin(ans).count("1"))
        count+=1
    
    print(count)
N, M = map(int, input().split())
useful_num_list = list(map(int, input().split()))

need_matches = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]

dp = [-1] * (N+1)
dp[0] = 0
for i in range(1, N+1):
    max_scale = -1
    for num in useful_num_list:
        if need_matches[num] <= i:
            scale = dp[i-need_matches[num]] + 1
            if max_scale < scale:
                max_scale = scale
    dp[i] = max_scale

useful_num_list.sort(reverse=True)
ans =""
n = N
while n > 0:
    ans_scale = ""
    for num in useful_num_list:
        if dp[n] - 1 == dp[n - need_matches[num]]:
            ans_scale = str(num)
            n -= need_matches[num]
            break
    ans += ans_scale
print(ans)


### FIXED CODE ###

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

need_matches = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]

dp = [-1] * (N+1)
dp[0] = 0
for i in range(1, N+1):
    max_scale = -1
    for num in useful_num_list:
        if need_matches[num] <= i:
            scale = dp[i-need_matches[num]] + 1
            if max_scale < scale:
                max_scale = scale
    dp[i] = max_scale

useful_num_list.sort(reverse=True)
ans = 0
n = N
while n > 0:
    for num in useful_num_list:
        if n < need_matches[num]:
            continue
        if dp[n] - 1 == dp[n - need_matches[num]]:
            ans += num * (10**(dp[n]-1))
            n -= need_matches[num]
            break
print(ans)
import math
nums=[int(i) for i in input().split()]
print(nums[0]*nums[1]//math.gcd(nums[0],nums[1]))

### FIXED CODE ###

import fractions
nums=[int(i) for i in input().split()]
print(nums[0]*nums[1]//fractions.gcd(nums[0],nums[1]))
# -*- coding: utf-8 -*-
A, B, C, D =map(int,input().split())
if (A+B) > (C+D):
  print(Left)
elif (A+B) == (C+D):
  print(Balanced)
else:
  print(Right)

### FIXED CODE ###

# -*- coding: utf-8 -*-
A, B, C, D =map(int,input().split())
if (A+B) > (C+D):
  print("Left")
elif (A+B) == (C+D):
  print("Balanced")
else:
  print("Right")
import copy
import math
import collections

inf = (10 ** 9) + 7
n, m = map(int, input().split())
prime_dict = {}
m_copy = copy.deepcopy(m)
while (m_copy % 2 == 0):
    m_copy = int(m_copy // 2)
    if 2 not in prime_dict.keys():
        prime_dict[2] = 1
    else:
        prime_dict[2] += 1
for i in range(3, int(math.sqrt(m)) + 1, 2):
    while (m_copy % i == 0):
        m_copy = int(m_copy // i)
        if i not in prime_dict.keys():
            prime_dict[i] = 1
        else:
            prime_dict[i] += 1
if m_copy != 1:
    if m_copy not in prime_dict.keys():
        prime_dict[m_copy] = 1
    else:
        prime_dict[m_copy] += 1
b = list(prime_dict.values())
ans = 1
for bb in b:
    ans *= dp[n - 1][bb]
    ans = ans % inf
print(ans)

### FIXED CODE ###

import copy
import math
import collections

inf = (10 ** 9) + 7
n, m = map(int, input().split())
prime_dict = {}
m_copy = copy.deepcopy(m)
while (m_copy % 2 == 0):
    m_copy = int(m_copy // 2)
    if 2 not in prime_dict.keys():
        prime_dict[2] = 1
    else:
        prime_dict[2] += 1
for i in range(3, int(math.sqrt(m)) + 1, 2):
    while (m_copy % i == 0):
        m_copy = int(m_copy // i)
        if i not in prime_dict.keys():
            prime_dict[i] = 1
        else:
            prime_dict[i] += 1
if m_copy != 1:
    if m_copy not in prime_dict.keys():
        prime_dict[m_copy] = 1
    else:
        prime_dict[m_copy] += 1
b = list(prime_dict.values())
ans = 1

dp = [[1 for _ in range(30)] for _ in range(n)]
for i in range(1, 30):
    for j in range(1,n):
        dp[j][i] = (dp[j - 1][i] + dp[j][i - 1]) % inf

for bb in b:
    ans *= dp[n - 1][bb]
    ans = ans % inf
print(ans)
l = input().split()
N = int(l[0])
M = int(l[1])
X = int(l[2])
cost1 = 0
cost2 = 0
j = 0
k = input().split()
for (e in k):
    if int(e) >= X:
        j = k.index(e)
    cost1 = cost1 + 1

for (i in range(j, M)):
    cost2 = cost2 + 1
if cost1 > cost2:
    print(cost1)
else:
    print(cost2)


### FIXED CODE ###

l = input().split()
N = int(l[0])
M = int(l[1])
X = int(l[2])
cost1 = 0
cost2 = 0
j = 0
k = input().split()
for e in k:
    if int(e) >= X:
        j = k.index(e)
        break
    cost1 = cost1 + 1

for i in range(j, M):
    cost2 = cost2 + 1
if cost1 > cost2:
    print(cost2)
else:
    print(cost1)
def dist(a, b, x, y, h):
    return h + abs(a - x) + abs(b - y)
 
N = int(input())
P = [[0 for i in range(101)] for j in range(101)]
x, y, h = map(int, input().split())
P[x][y] = h
for i in range(101):
    for j in range(101):
        P[i][j] = dist(i, j, x, y, h)
 
for i in range(N-1):
    a, b, c = map(int, input().split())
    if P[a][b] != c:
        P[a][b] = False
    for j in range(101):
        for k in range(101):
            if P[j][k] != False and P[j][k] != dist(j, k, a, b, c):
                P[j][k] = False
temp = (0, 0, 0)
for i in range(101):
    for j in range(101):
        if P[i][j] > ans:
            temp = (i, j, P[i][j])
print(temp[0], temp[1], temp[2])

### FIXED CODE ###

import math
N, M = map(int, input().split())
ulim = M//N
mid = int(math.sqrt(M))
if ulim >= mid:
    ans = []
    for i in range(1, mid+1):
        if M%i == 0:
            ans.append(i)
            if M//i <= ulim:
                ans.append(M//i)
    print(max(ans))

else:
    for i in reversed(range(1, ulim+1)):
        if M%i == 0:
            print(i)
            break
s = [input() for i in range(3)]
flg = 1
while(True):
    if flg == 1:
        if s[0] == '':
            print('A')
            break
        elif s[0][0] == 'a':
            s[0] = s[0][1:]
            flg = 1
        elif s[0][0] == 'b':
            s[0] = s[0][1:]
            flg = 2
        elif s[0][0] == 'c':
            s[0] = s[0][1:]
            flg = 3
        
    elif flg == 2:
        if s[1] == '':
            print('B')
            break
        elif s[1][0] == 'a':
            s[1] = s[1][1:]
            flg = 1
        elif s[1][0] == 'b':
            s[1] = s[1][1:]
            flg = 2
        elif s[1][0] == 'c':
            s[1] = s[1][1:]
            flg = 3

    elif flg == 3:
        if s[0] == '':
            print('C')
            break
        elif s[2][0] == 'a':
            s[2] = s[2][1:]
            flg = 1
        elif s[2][0] == 'b':
            s[2] = s[2][1:]
            flg = 2
        elif s[2][0] == 'c':
            s[2] = s[2][1:]
            flg = 3

### FIXED CODE ###

s = [input() for i in range(3)]
flg = 1
while(True):
    if flg == 1:
        if s[0] == '':
            print('A')
            break
        elif s[0][0] == 'a':
            s[0] = s[0][1:]
            flg = 1
        elif s[0][0] == 'b':
            s[0] = s[0][1:]
            flg = 2
        elif s[0][0] == 'c':
            s[0] = s[0][1:]
            flg = 3
        
    elif flg == 2:
        if s[1] == '':
            print('B')
            break
        elif s[1][0] == 'a':
            s[1] = s[1][1:]
            flg = 1
        elif s[1][0] == 'b':
            s[1] = s[1][1:]
            flg = 2
        elif s[1][0] == 'c':
            s[1] = s[1][1:]
            flg = 3

    elif flg == 3:
        if s[2] == '':
            print('C')
            break
        elif s[2][0] == 'a':
            s[2] = s[2][1:]
            flg = 1
        elif s[2][0] == 'b':
            s[2] = s[2][1:]
            flg = 2
        elif s[2][0] == 'c':
            s[2] = s[2][1:]
            flg = 3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from bisect import bisect_left
from heapq import heappush,heappop
from collections import deque
from sys import stdin,stdout


def main():
  ## input
  N,Q = map(int, stdin.readline().rstrip().split())
  STX = [[0,0,0] for _ in range(N)]
  for i in range(N):
    s,t,x = map(int, stdin.readline().rstrip().split())
    STX[i] = [x,s-x,t-x]
  Dn = [10**10] * Q
  ans = {}
  for i in range(Q):
    Dn[i] = int(stdin.readline().rstrip())
    ans[Dn[i]] = -1

  for x,s,t in sorted(list(STX)):
    l = bisect_left(Dn,s)
    while Dn[l] < t:
      ans[Dn[l]] = x
      Dn.pop(l)

  return ans


if __name__ == "__main__":
  ans = main()
  for d in sorted(list(ans.keys())):
    print(ans[d])
    


### FIXED CODE ###

import sys
from bisect import bisect_left



N,Q = map(int, input().split())
lines = sys.stdin.readlines()
kkk = []
for line in lines[:N]:
  s, t, x = map(int, line.split())
  kkk.append((x, s, t))
kkk.sort()
ddd = list(map(int, lines[N:]))

ans = [-1] * Q
skip = [-1] * Q
for x, s, t in kkk:
  ss = bisect_left(ddd, s - x)
  tt = bisect_left(ddd, t - x)
  while ss < tt:
    sk = skip[ss]
    if sk == -1:
      ans[ss] = x
      skip[ss] = tt
      ss += 1
    else:
      ss = sk

print('\n'.join(map(str, ans)))
r,D,x=map(int,input().split())
for i in range(10):
	x=r*x-D
    print(x)

### FIXED CODE ###

r,D,x=map(int,input().split())
for i in range(10):
	x=r*x-D
	print(x)
import numpy as np
n, k = map(int, input().split())
a = list(map(int, input().split()))


def diff(now, d):
    return abs(a[now] - a[now - d])

dp = [0] * n
dp[1] = diff(1, 1)
for depth in range(2, n):
    # dp[depth] = min(dp[depth - 1] + diff(depth, 1), dp[depth - 2] + diff(depth, 2))
    dp[depth] = min(dp[depth - x] + diff(depth, x) for x in range(1, min(depth, k) + 1))
print(dp[-1])


### FIXED CODE ###

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


def diff(now, d):
    return abs(a[now] - a[now - d])

dp = [0] * n
dp[1] = diff(1, 1)
for depth in range(2, n):
    # dp[depth] = min(dp[depth - 1] + diff(depth, 1), dp[depth - 2] + diff(depth, 2))
    dp[depth] = min(dp[depth - x] + diff(depth, x) for x in range(1, min(depth, k) + 1))
print(dp[-1])
n,k = map(int,input().split())
h=[int(input()) for i in range(n)]
h=sort(h)
mi=float('inf')
 
for i in range(n-k+1):
    mi = min(mi, h[i+k-1]-h[i])
 
print(mi)

### FIXED CODE ###

n,k = map(int,input().split())
h=list(int(input()) for i in range(n))
h.sort()
mi=float('inf')

for i in range(n-k+1):
    mi = min(mi, h[i+k-1]-h[i])
 
print(mi)
s=list(input())
s2=""
for i in range(len(s)):
  if i%==0:
    s2+=s[i]
print(s2)

### FIXED CODE ###

s=list(input())
s2=''
for i in range(len(s)):
  if i%2==0:
    s2+=s[i]
print(s2)
def main():
    n,a,b,c,d=map(int,input().split(' '))
    s=input()
    result = 'Yes'
    if a<b<d<c:
        tmp =0
        cnt=0
        for i in range(b-2,d+1):
            if s[i]=='#'and s[i+1]=='#':
                result='No'
                break
            if s[i]=='.':
                tmp +=1
            else:
                if cnt < tmp:
                    cnt = tmp
                    tmp =0

        if max(cnt,tmp) < 3:
                raise NameError
        if result =='Yes':
            for i in range(a,c-1):
                if s[i]=='#'and s[i+1]=='#':
                    result='No'
    else:
        for i in range(b,d-1):
            if s[i] =='#' and s[i+1]=='#':
                result ='No'
                break
        if result=='Yes':
            for i in range(a,c-1):
                if s[i] =='#' and s[i+1]=='#':
                    result = 'No'
    print(result)

main()

### FIXED CODE ###

n, a, b, c, d = map(int, input().split(' '))
s = input()
def rock(a,b):
    tmp = 0
    result = 1
    for i in s[a:b]:
        if tmp==2:
            result = 0
            break
        if i =='#':
            tmp +=1
        else:
            tmp=0
    return result
def main():
    result =0
    if c<d:
        result = min(rock(a,c-1),rock(b,d-1))
    else:
        result = min(rock(a,c-1),rock(b,d-1))
        if result ==1:
            result = 0
            for i in range(b-1,d):
                if s[i-1]=='.' and s[i]=='.' and s[i+1]=='.':
                    result = 1
    if result ==0:
        print('No')
    else:
        print('Yes')

main()
n, a, b = map(int, input().split())
retsu = ""
while len(retsu) < n:
    retsu += "b"*a + "r"*b
print(retsu[:n].count("b"))

### FIXED CODE ###

n, a, b = map(int, input().split())
ans = n // (a + b) * a
rem = n % (a + b)
ans += min(a, rem)
print(ans)
import itertools
import sys
from collections import Counter

sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
M = 1000000007
N = int(input())
left = list(map(int, input().split()))
assert len(left) == N
assert left[0] == 0

counter = Counter(left)


def dp(t, ns):
    cached = t.get(ns)
    if cached is not None:
        return cached
    remaining = sum(ns)
    #assert remaining > 0
    last_cnt = left[remaining - 1] + 1
    n1, n2, n3 = ns
    res = 0
    if last_cnt == n1:
        res += dp(t, tuple(sorted([n1 - 1, n2, n3])))
        res %= M
    if last_cnt == n2:
        res += dp(t, tuple(sorted([n1, n2 - 1, n3])))
        res %= M
    if last_cnt == n3:
        res += dp(t, tuple(sorted([n1, n2, n3 - 1])))
        res %= M
    # print(f"{remaining}: ({n1},{n2},{n3}) => {res}")
    t[ns] = res
    return res


def solve():
    h = [0, 0, 0]
    for i in range(N):
        k = counter[i]
        if k == 3:
            h[0] = h[1] = h[2] = i + 1
        elif k == 2:
            h[0] = h[1] = i + 1
        elif k == 1:
            h[0] = i + 1
        else:
            break
    #assert sum(h) == N
    t = dict()
    t[0, 0, 0] = 1
    res = dp(t, tuple(sorted(h)))
    return (res * len(set(itertools.permutations(h)))) % M


print(solve())


### FIXED CODE ###

import itertools
import sys
from collections import Counter

sys.setrecursionlimit(10 ** 9)
M = 1000000007
N = int(sys.stdin.readline())
left = list(map(int, sys.stdin.read().split()))
counter = Counter(left)


def dp(t, ns):
    cached = t.get(ns)
    if cached is not None:
        return cached
    remaining = sum(ns)
    assert remaining > 0
    last_cnt = left[remaining - 1] + 1
    n1, n2, n3 = ns
    res = 0
    if last_cnt == n1:
        res += dp(t, tuple(sorted([n1 - 1, n2, n3])))
        res %= M
    if last_cnt == n2:
        res += dp(t, tuple(sorted([n1, n2 - 1, n3])))
        res %= M
    if last_cnt == n3:
        res += dp(t, tuple(sorted([n1, n2, n3 - 1])))
        res %= M
    # print(f"{remaining}: ({n1},{n2},{n3}) => {res}")
    t[ns] = res
    return res


def solve():
    h = [0, 0, 0]
    for i in range(N):
        k = counter[i]
        if k == 3:
            h[0] = h[1] = h[2] = i + 1
        elif k == 2:
            h[0] = h[1] = i + 1
        elif k == 1:
            h[0] = i + 1
        else:
            break
    if sum(h) != N:
        return 0
    t = dict()
    t[0, 0, 0] = 1
    res = dp(t, tuple(sorted(h)))
    return (res * len(set(itertools.permutations(h)))) % M


print(solve())
X, Y = map(int(), input().split())

print(X+Y/2)

### FIXED CODE ###

X, Y = map(int, input().split())

print(X+(Y//2))
o = int(raw_input())
print o*o*3.141592653589,o*2*3.141592653589

### FIXED CODE ###

from decimal import Decimal
o = float(raw_input())
print Decimal(o*o*3.141592653589),Decimal(o*2*3.141592653589)
n=input()
num=len(n)-1

for i in range(2**num):
    l=['-']*num
    for j in range(num):
        if (i >> j) & 1:
            l[num-1-j]='+'

    formula=""
    for l_num, l_m in zip(n,l+""):
        formula += l_num + l_m
    
    if eval(formula)==7:
        print(formula"=7")
        break



### FIXED CODE ###

def dfs(i, Str, res):
    if i==3:
        if res==7:
            print(Str+"=7")
            exit()
        return
    
    dfs(i+1,Str+"+"+s[i+1],res+int(s[i+1]))
    dfs(i+1,Str+"-"+s[i+1],res-int(s[i+1]))

s=input()
dfs(0,s[0],int(s[0]))