import std.stdio,std.string,std.conv,std.algorithm,std.array;

int calc(string c,int a,int b)
{
	if(c == "+") return a+b;
	if(c == "-") return a-b;
	if(c == "*") return a*b;
	return 0;
}

int main()
{
	string s;
	while((s = readln.chomp).length != 0)
	{
		string[] _s = s.split(" ");
		int[4] a;
		foreach(i;0..4) a[i] = _s[i].to!int;
		a.sort;
		string[] ope = ["+","-","*"];
		bool flag = true;

		do
		{
			foreach(i;0..4)
			{
				foreach(j;0..4)
				{
					foreach(k;0..4)
					{
						int h = calc(ope[i],a[0],a[1]);
						int h2 = calc(ope[j],a[1],a[2]);
						int h3 = calc(ope[k],a[2],a[3]);
						if(calc(ope[j],h,h3) == 10 && flag)
						{
							writeln("((",a[0]," "+ope[i]," ",a[1],") "+ope[j]," (",a[2]," "+ope[k]," ",a[3],"))");
						
							flag = false;
						}
						if(calc(ope[k],calc(ope[j],h,a[2]),a[3]) == 10 && flag)
						{
							writeln("(((",a[0]," "+ope[i]," ",a[1],") "+ope[j]," ",a[2],") "+ope[k]," ",a[3],")");
							flag = false;
						}
						if(calc(ope[k],calc(ope[i],a[0],h2),a[3]) == 10 && flag)
						{
							writeln("((",a[0]," "+ope[i]," (",a[1]," "+ope[j]," ",a[2],")) "+ope[k]," " ,a[3],")"); 
							flag = false;
						}
					}
				}
			}
		}while(nextPermutation(a));
	}
	return 0;
}