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

bool nextPermutation(alias less="a<b", BidirectionalRange)
                    (ref BidirectionalRange range)
    if (isBidirectionalRange!BidirectionalRange &&
        hasSwappableElements!BidirectionalRange)
{
    // Ranges of 0 or 1 element have no distinct permutations.
    if (range.empty) return false;

    auto i = retro(range);
    auto last = i.save;

    // Find last occurring increasing pair of elements
    size_t n = 1;
    for (i.popFront(); !i.empty; i.popFront(), last.popFront(), n++)
    {
        if (binaryFun!less(i.front, last.front))
            break;
    }

    if (i.empty) {
        // Entire range is decreasing: it's lexicographically the greatest. So
        // wrap it around.
        range.reverse();
        return false;
    }

    // Find last element greater than i.front.
    auto j = find!((a) => binaryFun!less(i.front, a))(
                   takeExactly(retro(range), n));

    assert(!j.empty);   // shouldn't happen since i.front < last.front
    swap(i.front, j.front);
    reverse(takeExactly(retro(range), n));

    return true;
}

alias int function(int, int) pure nothrow @safe E;
alias Tuple!(char, E) 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], ")");
}