#include<iostream>
#include<cstdio>
#include<string>
#include<sstream>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
typedef long long ll;
void del_map(std::map<ll,ll> &m,ll a){
--m[a];
if(m[a]==0){
m.erase(a);
}
}
int main(){
using namespace std;
ll N;
cin>>N;
vector<ll> a;
int f=0;
for (size_t i = 0; i < N; i++)
{
cin>>a[i];
if(a[i]>=100){
f=2;
}else if(f!=2&&a[i]>=10){
f=1;
}
}
sort(a.begin(),a.end(),greater<ll>());
map<ll,ll> s;
for (size_t i = 0; i < N; i++)
{
if(s.count(a[i])){
++s[a[i]];
}else{
s[a[i]]=1;
}
}
string ans=to_string(a[0]);
long double cur=a[0];
for (size_t i = 1; i < N; i++)
{
vector<pair<long double,string>> next(4);
long double idx=0;
next[0]=make_pair(cur+a[i],"+");
next[1]=make_pair(cur-a[i],"-");
next[2]=make_pair(cur*a[i],"*");
next[3]=make_pair(cur/a[i],"/");
sort(next.begin(),next.end(),[](pair<long double,string> a,pair<long double,string> b){return abs(100.0-a.first)<abs(100.0-b.first);});
ans="( "+ans+" "+next[0].second+" "+to_string(a[i])+" )";
}
cout<<ans<<endl;
}
Battle History