#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define REP(i,j,k) for(int i = j ; i < k ; ++i)
#define MEM(i,j) memset(i , j , sizeof (i))
#define DBGG(i,j) cout << i << " " << j << endl
#define DB4(i,j,k,l) cout << i << " " << j << " " << k << " " << l << endl
//----------------------------------------------------------------
int a[10],d[10];
bool check[10];
vector<int> v[81];
vector<int> calv[120];
int flag = 0, cflag = 0;
void dfs(int step, int a[10], int chr){
if(step == 4){
REP(i, 0, 4){
if(a[i] == 3)
a[i] = chr;
v[flag].pb(a[i]);
}
flag++;
return;
}
REP(i, 0, 4){
if(check[i]){
check[i] = false;
a[step] = i;
dfs(step + 1, a, chr);
check[i] = true;
}
}
}
void cdfs(int step){
if(step == 5){
REP(i, 0, 5){
calv[cflag].pb(d[i]);
}
cflag+=1;
return;
}
REP(i, 0, 5){
if(check[i]){
check[i] = false;
d[step] = i;
cdfs(step + 1);
check[i] = true;
}
}
}
void input(){
v[72].pb(0),v[72].pb(0),v[72].pb(0),v[72].pb(1);
v[73].pb(1),v[73].pb(0),v[73].pb(0),v[73].pb(0);
v[74].pb(0),v[74].pb(0),v[74].pb(0),v[74].pb(2);
v[75].pb(2),v[75].pb(0),v[75].pb(0),v[75].pb(0);
v[76].pb(1),v[76].pb(1),v[76].pb(1),v[76].pb(2);
v[77].pb(2),v[77].pb(1),v[77].pb(1),v[77].pb(1);
v[78].pb(0),v[78].pb(0),v[78].pb(0),v[78].pb(0);
v[79].pb(1),v[79].pb(1),v[79].pb(1),v[79].pb(1);
v[80].pb(2),v[80].pb(2),v[80].pb(2),v[80].pb(2);
}
int main(){
MEM(check, true);
REP(i, 0, 81) v[i].clear(); REP(i, 0, 120) calv[i].clear();
dfs(0, a, 0); dfs(0, a, 1); dfs(0, a, 2); input(); MEM(check, true); cdfs(0);
int cal[5]; int cal2[5]; MEM(cal,1);
while(cal[0]&&cal[1]&&cal[2]&&cal[3]&&cal[4]){
REP(i, 0, 5)cin>>cal[i];memcpy(cal2, cal, sizeof(cal));
REP(c, 0, 120){
REP(i,0,5) cal[i] = cal2[calv[c][i]];
REP(i, 0, 81){
int temp;
temp = cal[0];
REP(j, 0, 4){
if(v[i][j]== 0){
temp+=cal[j+1];
}
else if(v[i][j] == 1){
temp-=cal[j+1];
}
else if(v[i][j] == 2){
temp*=cal[j+1];
}
}
if(temp == 23){
cout<<"((("<<cal[0]<<(v[i][0]?(v[i][0]-1?" * ":" - "):" + ")<<
cal[1]<<")"<<(v[i][1]?(v[i][1]-1?" * ":" - "):" + ")<<
cal[2]<<")"<<(v[i][2]?(v[i][2]-1?" * ":" - "):" + ")<<
cal[3]<<")"<<(v[i][3]?(v[i][3]-1?" * ": " - "):" + ")<<
cal[4]<<" )= "<<temp<<"\n";
}
}
}
}
return 0;
}