#include <iostream>
#include <map>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int cacul(int a, int b, char op) {
switch(op) {
case '+': return a + b;
case '-': return a - b;
case '*': return a * b;
case '/': return a / b;
}
return 0;
}
int main() {
vector<string> p = {"0", "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"};
string poker;
getline(cin, poker);
vector<int> nums;
for (char ch : poker) {
if (ch >= '2' && ch <= '9') nums.push_back(ch - '0');
if (ch == '1') nums.push_back(10);
if (ch == 'J') nums.push_back(11);
if (ch == 'Q') nums.push_back(12);
if (ch == 'K') nums.push_back(13);
if (ch == 'A') nums.push_back(1);
if (ch == 'o' || ch == 'O') {
cout << "ERROR" << endl;
return 0;
}
}
string op = "+-*/";
sort(nums.begin(), nums.end());
do {
for (char op1 : op) {
for (char op2 : op) {
for (char op3 : op) {
int first = cacul(nums[0], nums[1], op1);
int second = cacul(first, nums[2], op2);
int third = cacul(second, nums[3], op3);
if (third == 24) {
cout << p[nums[0]] << op1 << p[nums[1]] << op2 << p[nums[2]] << op3 << p[nums[3]];
return 0;
}
}
}
}
}while (next_permutation(nums.begin(), nums.end()));
cout << "NONE" << endl;
return 0;
}