import itertools
Value = {'A':1, '2':2, '3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9, '10':10, 'J':11, 'Q':12, 'K':13}
Calc = ['+', '-', '*', '//']
s = input()
if 'joker' in s or 'JOKER' in s:
    print('ERROR')
else:
#     l = [Value[x] for x in s.split()]
    ll = list(itertools.permutations([Value[x] for x in s.split()]))
    s = ''
    for n in ll:
        if s:
            break
        for c1 in Calc:
            if s:
                break
            for c2 in Calc:
                if s:
                    break
                for c3 in Calc:
                    s1 = '((' + str(n[0]) + c1 + str(n[1]) + ')' + c2 + str(n[2]) + ')' + c3 + str(n[3])
                    r = eval(s1)
                    if r == 24:
                        s = str(n[0]) + c1 + str(n[1]) + c2 + str(n[2]) + c3 + str(n[3])
                        break
    if s:
        s = s.replace('//', '/').replace('11', 'J').replace('12', 'Q').replace('13', 'K').replace('1', 'A')
        print(s)
    else:
        print('NONE')