Sitting in a station waiting room, Joisino is gazing at her train ticket.  The ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).  In the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with `+` or `-` so that the formula holds.  The given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.
import itertools
il = list(map(int,list(input())))

flag = True
for i in itertools.product(range(2),repeat=3):
    if flag:
        ticket_sum = il[0] + ((-1)**i[0]) * il[1] + ((-1)**i[1]) * il[2]+ ((-1)**i[2]) * il[3]
        if ticket_sum == 7:
            flag = False
            op1, op2, op3 = "-", "-", "-"
            if i[0]:
                op1 = "+"
            if i[1]:
                op2 = "+"
            if i[2]:
                op3 = "+"
            print(str(il[0])+op1+str(il[1])+op2+str(il[2])+op3+str(il[3])+"=7")
    else:
        break
from itertools import product
input_int_list = list(map(int, input()))

for operator_comb in product(range(2), repeat = len(input_int_list)-1):
    sum_value = input_int_list[0]
    formula_str = str(input_int_list[0])
    for i, operator in enumerate(operator_comb):
        if operator == 0:
            sum_value += input_int_list[i+1]
            formula_str += '+' + str(input_int_list[i+1])
        else:
            sum_value -= input_int_list[i+1] 
            formula_str += '-' + str(input_int_list[i+1])
    if sum_value == 7:
        print(formula_str + '=7')
        break