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

alias Tuple!(char, int function(int, int)pure nothrow @safe) OP;

OP[] op = [
    tuple('+', (int a, int b) => a + b),
    tuple('-', (int a, int b) => a - b),
    tuple('*', (int a, int b) => a * b),
];

void main()
{

    loop:while(true)
    {
        int[] input = readln.split.map!(to!int).array.sort;
        if(input[0] == 0) break;

        while(input.nextPermutation)
        {
            foreach(a; op) foreach(b; op) foreach(c; op)
            {
                if(calc(input, a, b, c) == 10)
                {
                    show(input, a, b, c);
                    continue loop;
                }
                else if(calc2(input, a, b, c) == 10)
                {
                    show2(input, a, b, c);
                    continue loop;
                }
            }
        }

        0.writeln;
    }
}

int calc(int[] input, OP a, OP b, OP c)
{
    return c[1](b[1](a[1](input[0], input[1]), input[2]), input[3]);
}

int calc2(int[] input, OP a, OP b, OP c)
{
    return b[1](a[1](input[0], input[1]), c[1](input[2], input[3]));
}

void show(int[] input, OP a, OP b, OP c)
{
    writeln("((", input[0], a[0], input[1], ")", b[0], input[2], ")", c[0], input[3]);
}

void show2(int[] input, OP a, OP b, OP c)
{
    writeln("(", input[0], a[0], input[1], ")", b[0], "(", input[2], c[0], input[3], ")");
}