Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int,list(input().strip()))

b_case = [b, -b]
c_case = [c, -c]
d_case = [d, -d]

#print(b_case, c_case, d_case)

for i in b_case:
    for j in c_case:
        for k in d_case:
            #print(a, i, j, k, a+i+j+k)
            if a + i + j + k == 7:
                print('{}{:+}{:+}{:+}{}'.format(a, i, j, k, '=7'))
                flag = 0
                break
                
        if flag == 0:
            break
    if flag == 0:
        break

Fixed submission:
a, b, c, d = list(map(int, list(input())))
if a + b + c + d == 7:
    print("{0}+{1}+{2}+{3}=7".format(a, b, c, d))
elif a + b + c - d == 7:
    print("{0}+{1}+{2}-{3}=7".format(a, b, c, d))
elif a + b - c + d == 7:
    print("{0}+{1}-{2}+{3}=7".format(a, b, c, d))
elif a - b + c + d == 7:
    print("{0}-{1}+{2}+{3}=7".format(a, b, c, d))
elif a - b - c + d == 7:
    print("{0}-{1}-{2}+{3}=7".format(a, b, c, d))
elif a - b + c - d == 7:
    print("{0}-{1}+{2}-{3}=7".format(a, b, c, d))
elif a + b - c - d == 7:
    print("{0}+{1}-{2}-{3}=7".format(a, b, c, d))
elif a - b - c - d == 7:
    print("{0}-{1}-{2}-{3}=7".format(a, b, c, d))

Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int,list(input().strip()))

b_case = [b, -b]
c_case = [c, -c]
d_case = [d, -d]

print(b_case, c_case, d_case)

for i in b_case:
    for j in c_case:
        for k in d_case:
            print(a, i, j, k, a+i+j+k)
            if a + i + j + k == 7:
                print('{}{:+}{:+}{:+}{}'.format(a, i, j, k, '=7'))
                flag = 2
                break
                
        if flag == 2:
            break
    if flag == 2:
        break

Fixed submission:
a, b, c, d = list(map(int, list(input())))
if a + b + c + d == 7:
    print("{0}+{1}+{2}+{3}=7".format(a, b, c, d))
elif a + b + c - d == 7:
    print("{0}+{1}+{2}-{3}=7".format(a, b, c, d))
elif a + b - c + d == 7:
    print("{0}+{1}-{2}+{3}=7".format(a, b, c, d))
elif a - b + c + d == 7:
    print("{0}-{1}+{2}+{3}=7".format(a, b, c, d))
elif a - b - c + d == 7:
    print("{0}-{1}-{2}+{3}=7".format(a, b, c, d))
elif a - b + c - d == 7:
    print("{0}-{1}+{2}-{3}=7".format(a, b, c, d))
elif a + b - c - d == 7:
    print("{0}+{1}-{2}-{3}=7".format(a, b, c, d))
elif a - b - c - d == 7:
    print("{0}-{1}-{2}-{3}=7".format(a, b, c, d))

Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int,list(input().strip()))

b_case = [b, -b]
c_case = [c, -c]
d_case = [d, -d]

for i in b_case:
    for j in c_case:
        for k in d_case:
            if a + i + j + k == 7:
                print('{}{:+}{:+}{:+}{}'.format(a, i, j, k, '=7'))
                flag = 1
                break
        
        if flag == 1:
            break
    if flag == 1:
        break

Fixed submission:
a, b, c, d = list(map(int, list(input())))
if a + b + c + d == 7:
    print("{0}+{1}+{2}+{3}=7".format(a, b, c, d))
elif a + b + c - d == 7:
    print("{0}+{1}+{2}-{3}=7".format(a, b, c, d))
elif a + b - c + d == 7:
    print("{0}+{1}-{2}+{3}=7".format(a, b, c, d))
elif a - b + c + d == 7:
    print("{0}-{1}+{2}+{3}=7".format(a, b, c, d))
elif a - b - c + d == 7:
    print("{0}-{1}-{2}+{3}=7".format(a, b, c, d))
elif a - b + c - d == 7:
    print("{0}-{1}+{2}-{3}=7".format(a, b, c, d))
elif a + b - c - d == 7:
    print("{0}+{1}-{2}-{3}=7".format(a, b, c, d))
elif a - b - c - d == 7:
    print("{0}-{1}-{2}-{3}=7".format(a, b, c, d))

Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int,list(input().strip()))

b_case = [b, -b]
c_case = [c, -c]
d_case = [d, -d]

for i in b_case:
    for j in c_case:
        for k in d_case:
            if a + i + j + k == 7:
                print('{}{:+}{:+}{:+}{}'.format(a, i, j, k, '=7'))
                flag = True
                break
        
        if flag == True:
            break
    if flag == True:
        break

Fixed submission:
a, b, c, d = list(map(int, list(input())))
if a + b + c + d == 7:
    print("{0}+{1}+{2}+{3}=7".format(a, b, c, d))
elif a + b + c - d == 7:
    print("{0}+{1}+{2}-{3}=7".format(a, b, c, d))
elif a + b - c + d == 7:
    print("{0}+{1}-{2}+{3}=7".format(a, b, c, d))
elif a - b + c + d == 7:
    print("{0}-{1}+{2}+{3}=7".format(a, b, c, d))
elif a - b - c + d == 7:
    print("{0}-{1}-{2}+{3}=7".format(a, b, c, d))
elif a - b + c - d == 7:
    print("{0}-{1}+{2}-{3}=7".format(a, b, c, d))
elif a + b - c - d == 7:
    print("{0}+{1}-{2}-{3}=7".format(a, b, c, d))
elif a - b - c - d == 7:
    print("{0}-{1}-{2}-{3}=7".format(a, b, c, d))

Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int,list(input().strip()))

b_case = [b, -b]
c_case = [c, -c]
d_case = [d, -d]

ans = ''

for i in b_case:
    for j in c_case:
        for k in d_case:
            if a + i + j + k == 7:
                print('{}{:+}{:+}{:+}{}'.format(a, i, j, k, '=7'))
                flag = True
                break
        
        if flag == True:
            break
    if flag == True:
        break

Fixed submission:
a, b, c, d = list(map(int, list(input())))
if a + b + c + d == 7:
    print("{0}+{1}+{2}+{3}=7".format(a, b, c, d))
elif a + b + c - d == 7:
    print("{0}+{1}+{2}-{3}=7".format(a, b, c, d))
elif a + b - c + d == 7:
    print("{0}+{1}-{2}+{3}=7".format(a, b, c, d))
elif a - b + c + d == 7:
    print("{0}-{1}+{2}+{3}=7".format(a, b, c, d))
elif a - b - c + d == 7:
    print("{0}-{1}-{2}+{3}=7".format(a, b, c, d))
elif a - b + c - d == 7:
    print("{0}-{1}+{2}-{3}=7".format(a, b, c, d))
elif a + b - c - d == 7:
    print("{0}+{1}-{2}-{3}=7".format(a, b, c, d))
elif a - b - c - d == 7:
    print("{0}-{1}-{2}-{3}=7".format(a, b, c, d))