// 若干修正
#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

template <class N>
struct calculator {
	typedef string op_type;
	typedef map<op_type, function<N(N,N)> > op_map;

	vector<N>  elems;
	vector<op_type> ops;

	op_map s_opmap = {
		{"+", plus<N>()},    {"-", minus<N>()},
		{"/", divides<N>()}, {"*", multiplies<N>()} };
		
	vector<vector<op_type>> prio = { {"*","/"}, {"+","-"} };

	calculator(vector<N>& e) : elems(e) {}

	bool validate(){
		vector<N> cvals(elems);
		vector<op_type>  cops(ops);

		for( auto ops: prio )
			for( int i = 0; i < cops.size(); i++ )
				if( any_of( ops.begin(), ops.end(),
						bind( equal_to<op_type>(), cops[i], placeholders::_1 ) )
				){
					cvals[i] = s_opmap[ cops[i] ](cvals[i],cvals[i+1]);
	
					cvals.erase(cvals.begin() + i+1);
					cops.erase(cops.begin() + i--);
				}

		return ( cvals.size() == 2 && cvals.back() == cvals.front() );
	}

	void calculate(){
		this->ops = vector<op_type>();
		bool found = next_comb();

		cout << elems[0] << " "; // head
		for( size_t i = 1; i < elems.size() -1; i++ )
			found && (cout << ops[i-1]), cout << " " << elems[i] << " ";
	
		cout << (found ? "= " : "has no op-combs to be ") << elems.back() << endl;
	}
	
	bool next_comb(){
		return ( ops.size() == (elems.size() -2) ) ? validate() :
		 	any_of(s_opmap.begin(),s_opmap.end(),[&]( typename op_map::value_type& o ){
				ops.push_back(o.first);
				return next_comb() || (ops.pop_back(), false);
			});
	}
};

template < class num_type >
int main_deleg(){
	for( string line; getline(cin,line); ){
		replace (line.begin(), line.end(), ':', ' ');
		
		istringstream iss(line);
		vector<num_type> list;

		for( num_type n; ! (iss >> n).fail(); list.push_back(n) );

		if( list.size() > 1 )
			calculator<num_type>(list).calculate();
		else
			cout << line << ": invalid line. skip. " << endl;
	}
	return 0;
}

int main(){ return main_deleg<double>(); }

