let str;
let flag;
let text = "";
const d = { 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10, J: 11, Q: 12, K: 13, A: 1, 2: 2 }
while ((str = readline())) {
let arr = str.split(" ")
flag = "NONE";
if (!arr.includes("joker") && !arr.includes("JOKER")) {
dfs(0, 0, arr, text);
} else {
flag = "ERROR";
}
print(flag === "DONE" ? text : flag);
}
function dfs(step, sum, arr, res) {
if (step == 4) {
if (sum == 24) {
flag = "DONE";
text = res
return;
}
} else {
step++;
for (let index in arr) {
let _arr = JSON.parse(JSON.stringify(arr));
let num = _arr.splice(index, 1)[0];
if(step == 1){
dfs(step, sum + d[num], _arr, `${num}`);
}else {
dfs(step, sum + d[num], _arr, `${res}+${num}`);
dfs(step, sum - d[num], _arr, `${res}-${num}`);
dfs(step, sum * d[num], _arr, `${res}*${num}`);
dfs(step, sum / d[num], _arr, `${res}/${num}`);
}
}
}
}