def re(a, b, x):
    if x == 0:
        return a + b
    if x == 1:
        return a - b
    if x == 2:
        return a * b
    if x == 3:
        return a // b


while True:
    try:
        ysf = ['+', '-', '*', '//']
        s = input()
        if 'joker' in s or 'JOKER' in s:
            print('ERROR')
        else:
            ss = ''
            ss = s.replace('A', '1').replace('J', '11').replace('Q', '12').replace('K', '13')
            arrs1 = list(map(str, s.split()))  # 源字符串
            arrs2 = list(map(int, ss.split()))  # 处理后字符串
            str1 = 'NONE'
            # A(4,4)排序组合有4*3*2 = 24种
            alls1 = []  # 存储所有可能排序组合的源字符串,方便输出
            alls2 = []  # 存储所有可能排序组合的计算字符串方便计算
            index = {0, 1, 2, 3}  # 下标,集合是为了方便处理下面集合间的运算

            for i in index:
                for j in index - {i}:  # 排除第一个i(已使用) 如0,已使用,则下面的从{1,2,3}中选择,下面同理
                    for k in index - {i, j}:  # 排除i和j(已使用)
                        for l in index - {i, j, k}:
                            alls1.append([arrs1[i], arrs1[j], arrs1[k], arrs1[l]])
                            alls2.append([arrs2[i], arrs2[j], arrs2[k], arrs2[l]])
                            
            for s2_index in range(len(alls2)): # 遍历所有可能的排序组合
                # print(alls2[s2_index])
                for i in range(4): # 前两个数字有四种可能的计算方式
                    a = re(alls2[s2_index][0], alls2[s2_index][1], i)
                    # print(a)
                    for j in range(4):
                        b = re(a, alls2[s2_index][2], j)
                        for k in range(4):
                            c = re(b, alls2[s2_index][3], k)
                            # print(c)
                            if c == 24:
                                str1 = alls1[s2_index][0] + ysf[i] + alls1[s2_index][1] + ysf[j] + alls1[s2_index][2] + ysf[k] + alls1[s2_index][3]
                                str1 = str1.replace('//', '/')
            print(str1)
    except:
        break