Problem:
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.

Incorrect submission (verdict: Wrong Answer):
N = input()
H = [int(N[0]), int(N[1]), int(N[2]), int(N[3])]
print(H)
A = H[0]
B = H[1]
C = H[2]
D = H[3]
# A = N[0], B = N[1], C = N[2], D = N[3]
# a = N[0], b = N[1], c = N[2], d = N[3]
# A = int(a), B = int(b), C = int(c), D = int(d)
c1 = {'op1':'+', 'op2':'+', 'op3':'+'}
c2 = {'op1':'+', 'op2':'+', 'op3':'-'}
c3 = {'op1':'+', 'op2':'-', 'op3':'+'}
c4 = {'op1':'+', 'op2':'-', 'op3':'-'}
c5 = {'op1':'-', 'op2':'+', 'op3':'+'}
c6 = {'op1':'-', 'op2':'+', 'op3':'-'}
c7 = {'op1':'-', 'op2':'-', 'op3':'+'}
c8 = {'op1':'-', 'op2':'+', 'op3':'+'}

if A+B+C+D == 7:
    print(str(A) + c1['op1'] + str(B) + c1['op2'] + str(C) + c1['op3'] + str(D) + '= 7')
elif A+B+C-D == 7:
    print(str(A) + c2['op1'] + str(B) + c2['op2'] + str(C) + c2['op3'] + str(D) + '= 7')
elif A+B-C+D == 7:
    print(str(A) + c3['op1'] + str(B) + c3['op2'] + str(C) + c3['op3'] + str(D) + '= 7')
elif A+B-C-D == 7:
    print(str(A) + c4['op1'] + str(B) + c4['op2'] + str(C) + c4['op3'] + str(D) + '= 7')
elif A-B+C+D == 7:
    print(str(A) + c5['op1'] + str(B) + c5['op2'] + str(C) + c5['op3'] + str(D) + '= 7')
elif A-B+C-D == 7:
    print(str(A) + c6['op1'] + str(B) + c6['op2'] + str(C) + c6['op3'] + str(D) + '= 7')
elif A-B-C+D == 7:
    print(str(A) + c7['op1'] + str(B) + c7['op2'] + str(C) + c7['op3'] + str(D) + '= 7')
elif A-B-C-D == 7:
    print(str(A) + c8['op1'] + str(B) + c8['op2'] + str(C) + c8['op3'] + str(D) + '= 7')


Fixed, accepted submission:
N = input()
H = [int(N[0]), int(N[1]), int(N[2]), int(N[3])]
A = H[0]
B = H[1]
C = H[2]
D = H[3]
# A = N[0], B = N[1], C = N[2], D = N[3]
# a = N[0], b = N[1], c = N[2], d = N[3]
# A = int(a), B = int(b), C = int(c), D = int(d)
c1 = {'op1':'+', 'op2':'+', 'op3':'+'}
c2 = {'op1':'+', 'op2':'+', 'op3':'-'}
c3 = {'op1':'+', 'op2':'-', 'op3':'+'}
c4 = {'op1':'+', 'op2':'-', 'op3':'-'}
c5 = {'op1':'-', 'op2':'+', 'op3':'+'}
c6 = {'op1':'-', 'op2':'+', 'op3':'-'}
c7 = {'op1':'-', 'op2':'-', 'op3':'+'}
c8 = {'op1':'-', 'op2':'+', 'op3':'+'}

if A+B+C+D == 7:
    print(str(A) + c1['op1'] + str(B) + c1['op2'] + str(C) + c1['op3'] + str(D) + '=7')
elif A+B+C-D == 7:
    print(str(A) + c2['op1'] + str(B) + c2['op2'] + str(C) + c2['op3'] + str(D) + '=7')
elif A+B-C+D == 7:
    print(str(A) + c3['op1'] + str(B) + c3['op2'] + str(C) + c3['op3'] + str(D) + '=7')
elif A+B-C-D == 7:
    print(str(A) + c4['op1'] + str(B) + c4['op2'] + str(C) + c4['op3'] + str(D) + '=7')
elif A-B+C+D == 7:
    print(str(A) + c5['op1'] + str(B) + c5['op2'] + str(C) + c5['op3'] + str(D) + '=7')
elif A-B+C-D == 7:
    print(str(A) + c6['op1'] + str(B) + c6['op2'] + str(C) + c6['op3'] + str(D) + '=7')
elif A-B-C+D == 7:
    print(str(A) + c7['op1'] + str(B) + c7['op2'] + str(C) + c7['op3'] + str(D) + '=7')
elif A-B-C-D == 7:
    print(str(A) + c8['op1'] + str(B) + c8['op2'] + str(C) + c8['op3'] + str(D) + '=7')