#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <iostream>


using namespace std;


int add(int a, int b) { return a + b; }
int sub(int a, int b) { return a - b; }
int mul(int a, int b) { return a * b; }

int main()
{
	int (*ope[])(int, int) = { add, sub, mul };
	char* os[] = { "+", "-", "*" };

	int t[4];
	while (true)
	{
		scanf("%d %d %d %d", t, t+1, t+2, t+3);
		if (t[0] == 0 && t[1] == 0 && t[2] == 0 && t[3] == 0)
			break;

		int f = 0;
		int i, j, k;
		sort(t, t+4);
		do
		{
			for (i = 0; i < 3; ++i)
			{
				for (j = 0; j < 3; ++j)
				{
					for (k = 0; k < 3; ++k)
					{
						if (ope[k](ope[j](ope[i](t[0], t[1]), t[2]), t[3]) == 10)
						{
							f = 1;
							goto LoopEnd;
						}
						else if(ope[j](ope[i](t[0], t[1]), ope[k](t[2], t[3])) == 10)
						{
							f = 2;
							goto LoopEnd;
						}
					}
				}
			}
		} while (next_permutation(t, t+4));
LoopEnd:
		if (f == 1)
			printf("(((%d %s %d) %s %d ) %s %d)\n", t[0], os[i], t[1], os[j], t[2], os[k], t[3]);
		else if(f == 2)
			printf("((%d %s %d) %s (%d %s %d))\n", t[0], os[i], t[1], os[j], t[2], os[k], t[3]);
		else
			puts("0");
	}

	return 0;
}