#include <iostream>
#include <vector>
#include <string>

typedef std::pair<int,std::string> num_op;

void show(std::vector<num_op> vec) {
	for (std::vector<num_op>::iterator it = vec.begin(); it != vec.end(); it++) {
		if ((*it).first==10) std::cout << (*it).second << std::endl;
	}
}

int main()
{
	int a, b, c, d;
	
	while(true) {
		std::cin >> a >> b >> c >> d;
		
		if (a==0 && b==0 && c==0 && d==0) break;
		
		std::vector<num_op> vec_ab(4);
		vec_ab.push_back( num_op(a+b,"( a + b )") );
		vec_ab.push_back( num_op(a-b,"( a - b )") );
		vec_ab.push_back( num_op(b-a,"( b - a )") );
		vec_ab.push_back( num_op(a*b,"( a * b )") );
		
		std::vector<num_op> vec_ac(4);
		vec_ac.push_back( num_op(a+c,"( a + c )") );
		vec_ac.push_back( num_op(a-c,"( a - c )") );
		vec_ac.push_back( num_op(c-a,"( c - a )") );
		vec_ac.push_back( num_op(a*c,"( a * c )") );
		
		std::vector<num_op> vec_ad(4);
		vec_ad.push_back( num_op(a+d,"( a + d )") );
		vec_ad.push_back( num_op(a-d,"( a - d )") );
		vec_ad.push_back( num_op(d-a,"( d - a )") );
		vec_ad.push_back( num_op(a*d,"( a * d )") );
		
		std::vector<num_op> vec_bc(4);
		vec_bc.push_back( num_op(b+c,"( b + c )") );
		vec_bc.push_back( num_op(b-c,"( b - c )") );
		vec_bc.push_back( num_op(c-b,"( c - b )") );
		vec_bc.push_back( num_op(b*c,"( b * c )") );
		
		std::vector<num_op> vec_bd(4);
		vec_bd.push_back( num_op(b+d,"( b + d )") );
		vec_bd.push_back( num_op(b-d,"( b - d )") );
		vec_bd.push_back( num_op(d-b,"( d - b )") );
		vec_bd.push_back( num_op(b*d,"( b * d )") );
		
		std::vector<num_op> vec_cd(4);
		vec_cd.push_back( num_op(c+d,"( c + d )") );
		vec_cd.push_back( num_op(c-d,"( c - d )") );
		vec_cd.push_back( num_op(d-c,"( d - c )") );
		vec_cd.push_back( num_op(c*d,"( c * d )") );
		
		std::vector<num_op> vec_abc(48);
		for (std::vector<num_op>::iterator it = vec_ab.begin(); it != vec_ab.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_abc.push_back( num_op((*it).first + c, "( " + (*it).second + " + c )") );
			//vec_abc.push_back( num_op((*it).first + c, std::string("( ").append((*it).second).append(" + c )")) );
			vec_abc.push_back( num_op((*it).first - c, "( " + (*it).second + " - c )") );
			//vec_abc.push_back( num_op((*it).first - c, std::string("( ").append((*it).second).append(" - c )")) );
			vec_abc.push_back( num_op(c - (*it).first, "( c - " + (*it).second + " )") );
			//vec_abc.push_back( num_op(c - (*it).first, std::string("( c - ").append((*it).second).append(" )")) );
			vec_abc.push_back( num_op((*it).first * c, "( " + (*it).second + " * c )") );
			//vec_abc.push_back( num_op((*it).first * c, std::string("( ").append((*it).second).append(" * c )")) );
		}
		for (std::vector<num_op>::iterator it = vec_ac.begin(); it != vec_ac.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_abc.push_back( num_op((*it).first + b, "( " + (*it).second + " + b )") );
			vec_abc.push_back( num_op((*it).first - b, "( " + (*it).second + " - b )") );
			vec_abc.push_back( num_op(b - (*it).first, "( b - " + (*it).second + " )") );
			vec_abc.push_back( num_op((*it).first * b, "( " + (*it).second + " * b )") );
			//vec_abc.push_back( num_op((*it).first + b, std::string("( ").append((*it).second).append(" + b )")) );
			//vec_abc.push_back( num_op((*it).first - b, std::string("( ").append((*it).second).append(" - b )")) );
			//vec_abc.push_back( num_op(b - (*it).first, std::string("( b - ").append((*it).second).append(" )")) );
			//vec_abc.push_back( num_op((*it).first * b, std::string("( ").append((*it).second).append(" * b )")) );
		}
		for (std::vector<num_op>::iterator it = vec_bc.begin(); it != vec_bc.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_abc.push_back( num_op((*it).first + a, "( " + (*it).second + " + a )") );
			vec_abc.push_back( num_op((*it).first - a, "( " + (*it).second + " - a )") );
			vec_abc.push_back( num_op(a - (*it).first, "( a - " + (*it).second + " )") );
			vec_abc.push_back( num_op((*it).first * a, "( " + (*it).second + " * a )") );
			//vec_abc.push_back( num_op((*it).first + a, std::string("( ").append((*it).second).append(" + a )")) );
			//vec_abc.push_back( num_op((*it).first - a, std::string("( ").append((*it).second).append(" - a )")) );
			//vec_abc.push_back( num_op(a - (*it).first, std::string("( a - ").append((*it).second).append(" )")) );
			//vec_abc.push_back( num_op((*it).first * a, std::string("( ").append((*it).second).append(" * a )")) );
		}
		
		std::vector<num_op> vec_abd(48);
		for (std::vector<num_op>::iterator it = vec_ab.begin(); it != vec_ab.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_abd.push_back( num_op((*it).first + d, "( " + (*it).second + " + d )") );
			vec_abd.push_back( num_op((*it).first - d, "( " + (*it).second + " - d )") );
			vec_abd.push_back( num_op(d - (*it).first, "( d - " + (*it).second + " )") );
			vec_abd.push_back( num_op((*it).first * d, "( " + (*it).second + " * d )") );
		}
		for (std::vector<num_op>::iterator it = vec_ad.begin(); it != vec_ad.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_abd.push_back( num_op((*it).first + b, "( " + (*it).second + " + b )") );
			vec_abd.push_back( num_op((*it).first - b, "( " + (*it).second + " - b )") );
			vec_abd.push_back( num_op(b - (*it).first, "( b - " + (*it).second + " )") );
			vec_abd.push_back( num_op((*it).first * b, "( " + (*it).second + " * b )") );
		}
		for (std::vector<num_op>::iterator it = vec_bd.begin(); it != vec_bd.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_abd.push_back( num_op((*it).first + a, "( " + (*it).second + " + a )") );
			vec_abd.push_back( num_op((*it).first - a, "( " + (*it).second + " - a )") );
			vec_abd.push_back( num_op(a - (*it).first, "( a - " + (*it).second + " )") );
			vec_abd.push_back( num_op((*it).first * a, "( " + (*it).second + " * a )") );
		}
		
		std::vector<num_op> vec_acd(48);
		for (std::vector<num_op>::iterator it = vec_ac.begin(); it != vec_ac.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_acd.push_back( num_op((*it).first + d, "( " + (*it).second + " + d )") );
			vec_acd.push_back( num_op((*it).first - d, "( " + (*it).second + " - d )") );
			vec_acd.push_back( num_op(d - (*it).first, "( d - " + (*it).second + " )") );
			vec_acd.push_back( num_op((*it).first * d, "( " + (*it).second + " * d )") );
		}
		for (std::vector<num_op>::iterator it = vec_ad.begin(); it != vec_ad.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_acd.push_back( num_op((*it).first + c, "( " + (*it).second + " + c)") );
			vec_acd.push_back( num_op((*it).first - c, "( " + (*it).second + " - c)") );
			vec_acd.push_back( num_op(c - (*it).first, "( c - " + (*it).second + ")") );
			vec_acd.push_back( num_op((*it).first * c, "( " + (*it).second + " * c)") );
		}
		for (std::vector<num_op>::iterator it = vec_cd.begin(); it != vec_cd.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_acd.push_back( num_op((*it).first + a, "( " + (*it).second + " + a)") );
			vec_acd.push_back( num_op((*it).first - a, "( " + (*it).second + " - a)") );
			vec_acd.push_back( num_op(a - (*it).first, "( a - " + (*it).second + ")") );
			vec_acd.push_back( num_op((*it).first * a, "( " + (*it).second + " * a)") );
		}
		
		std::vector<num_op> vec_bcd(48);
		for (std::vector<num_op>::iterator it = vec_bc.begin(); it != vec_bc.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_bcd.push_back( num_op((*it).first + d, "( " + (*it).second + " + d )") );
			vec_bcd.push_back( num_op((*it).first - d, "( " + (*it).second + " - d )") );
			vec_bcd.push_back( num_op(d - (*it).first, "( d - " + (*it).second + " )") );
			vec_bcd.push_back( num_op((*it).first * d, "( " + (*it).second + " * d )") );
		}
		for (std::vector<num_op>::iterator it = vec_bd.begin(); it != vec_bd.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_bcd.push_back( num_op((*it).first + c, "( " + (*it).second + " + c )") );
			vec_bcd.push_back( num_op((*it).first - c, "( " + (*it).second + " - c )") );
			vec_bcd.push_back( num_op(c - (*it).first, "( c - " + (*it).second + " )") );
			vec_bcd.push_back( num_op((*it).first * c, "( " + (*it).second + " * c )") );
		}
		for (std::vector<num_op>::iterator it = vec_cd.begin(); it != vec_cd.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_bcd.push_back( num_op((*it).first + b, "( " + (*it).second + " + b )") );
			vec_bcd.push_back( num_op((*it).first - b, "( " + (*it).second + " - b )") );
			vec_bcd.push_back( num_op(b - (*it).first, "( b - " + (*it).second + " )") );
			vec_bcd.push_back( num_op((*it).first * b, "( " + (*it).second + " * b )") );
		}
		
		std::vector<num_op> vec_abcd(256);
		for (std::vector<num_op>::iterator it = vec_abc.begin(); it != vec_abc.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_abcd.push_back( num_op((*it).first + d, "( " + (*it).second + " + d )") );
			vec_abcd.push_back( num_op((*it).first - d, "( " + (*it).second + " - d )") );
			vec_abcd.push_back( num_op(d - (*it).first, "( d - " + (*it).second + " )") );
			vec_abcd.push_back( num_op((*it).first * d, "( " + (*it).second + " * d )") );
		}
		for (std::vector<num_op>::iterator it = vec_abd.begin(); it != vec_abd.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_abcd.push_back( num_op((*it).first + c, "( " + (*it).second + " + c )") );
			vec_abcd.push_back( num_op((*it).first - c, "( " + (*it).second + " - c )") );
			vec_abcd.push_back( num_op(c - (*it).first, "( c - " + (*it).second + " )") );
			vec_abcd.push_back( num_op((*it).first * c, "( " + (*it).second + " * c )") );
		}
		for (std::vector<num_op>::iterator it = vec_acd.begin(); it != vec_acd.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_abcd.push_back( num_op((*it).first + b, "( " + (*it).second + " + b )") );
			vec_abcd.push_back( num_op((*it).first - b, "( " + (*it).second + " - b )") );
			vec_abcd.push_back( num_op(b - (*it).first, "( b - " + (*it).second + " )") );
			vec_abcd.push_back( num_op((*it).first * b, "( " + (*it).second + " * b )") );
		}
		for (std::vector<num_op>::iterator it = vec_bcd.begin(); it != vec_bcd.end(); ++it) {
			if ((*it).second.empty()) continue;
			vec_abcd.push_back( num_op((*it).first + a, "( " + (*it).second + " + a )") );
			vec_abcd.push_back( num_op((*it).first - a, "( " + (*it).second + " - a )") );
			vec_abcd.push_back( num_op(a - (*it).first, "( a - " + (*it).second + " )") );
			vec_abcd.push_back( num_op((*it).first * a, "( " + (*it).second + " * a )") );
		}
		
		for (std::vector<num_op>::iterator it = vec_ab.begin(); it != vec_ab.end(); ++it) {
			if ((*it).second.empty()) continue;
			for (std::vector<num_op>::iterator it2 = vec_cd.begin(); it2 != vec_cd.end(); ++it2) {
				if ((*it2).second.empty()) continue;
				vec_abcd.push_back( num_op((*it).first + (*it2).first, "( " + (*it).second + " + " + (*it2).second + " )") );
				vec_abcd.push_back( num_op((*it).first - (*it2).first, "( " + (*it).second + " - " + (*it2).second + " )") );
				vec_abcd.push_back( num_op((*it2).first - (*it).first, "( " + (*it2).second + " - " + (*it).second + " )") );
				vec_abcd.push_back( num_op((*it).first * (*it2).first, "( " + (*it).second + " * " + (*it2).second + " )") );
			}
		}
		for (std::vector<num_op>::iterator it = vec_ac.begin(); it != vec_ac.end(); ++it) {
			if ((*it).second.empty()) continue;
			for (std::vector<num_op>::iterator it2 = vec_bd.begin(); it2 != vec_bd.end(); ++it2) {
				if ((*it2).second.empty()) continue;
				vec_abcd.push_back( num_op((*it).first + (*it2).first, "( " + (*it).second + " + " + (*it2).second + " )") );
				vec_abcd.push_back( num_op((*it).first - (*it2).first, "( " + (*it).second + " - " + (*it2).second + " )") );
				vec_abcd.push_back( num_op((*it2).first - (*it).first, "( " + (*it2).second + " - " + (*it).second + " )") );
				vec_abcd.push_back( num_op((*it).first * (*it2).first, "( " + (*it).second + " * " + (*it2).second + " )") );
			}
		}
		for (std::vector<num_op>::iterator it = vec_ad.begin(); it != vec_ad.end(); ++it) {
			if ((*it).second.empty()) continue;
			for (std::vector<num_op>::iterator it2 = vec_bc.begin(); it2 != vec_bc.end(); ++it2) {
				if ((*it2).second.empty()) continue;
				vec_abcd.push_back( num_op((*it).first + (*it2).first, "( " + (*it).second + " + " + (*it2).second + " )") );
				vec_abcd.push_back( num_op((*it).first - (*it2).first, "( " + (*it).second + " - " + (*it2).second + " )") );
				vec_abcd.push_back( num_op((*it2).first - (*it).first, "( " + (*it2).second + " - " + (*it).second + " )") );
				vec_abcd.push_back( num_op((*it).first * (*it2).first, "( " + (*it).second + " * " + (*it2).second + " )") );
			}
		}
		
		//show(vec_abcd);
		
		bool found = false;
		for (std::vector<num_op>::iterator it = vec_abcd.begin(); it != vec_abcd.end(); ++it) {
			if ((*it).first == 10) {
				std::string str = (*it).second;
				//std::cout<< str << std::endl;
				for (int i=0; i<str.size(); i++) {
					if (str[i] == 'a') std::cout << a;
					else if (str[i] == 'b') std::cout << b;
					else if (str[i] == 'c') std::cout << c;
					else if (str[i] == 'd') std::cout << d;
					else std::cout << str[i];
				}
				std::cout << std::endl;
				found = true;
			}
			if (found) break;
		}
		
		if(!found) std::cout << 0 << std::endl;
	}
	return 0;
}


Measured memory_bytes: 3348