using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class SearchCombination
    {
        readonly char[] op = new char[] { '+', '-', '*' };

        internal string result;

        int[] nums;
        int a, b, c, d, x, y, z;

        public void Solve(int[] source)
        {
            for (int i = 0; i < 4; i++)
            {
                nums = (int[])source.Clone();

                Swap(0, i);
                a = nums[0];

                for (int j = 1; j < 4; j++)
                {
                    Swap(1, 2);
                    b = nums[1]; c = nums[2]; d = nums[3];

                    if (Search()) return;

                    if (c != d)
                    {
                        Swap(2, 3);
                        c = nums[2]; d = nums[3];

                        if (Search()) return;
                    }
                }
            }
        }

        private bool Search()
        {
            result = "0";
            int p = SearchPattern();

            if (p != -1)
            {
                result = MakeString(p);
                return true;
            }
            return false;
        }

        private void Swap(int n, int m)
        {
            int temp = nums[n];
            nums[n] = nums[m];
            nums[m] = temp;
        }

        private int SearchPattern()
        {
            for (x = 0; x < 3; x++)
                for (y = 0; y < 3; y++)
                    for (z = 0; z < 3; z++)
                    {
                        if (Calc(Calc(Calc(a, x, b), y, c), z, d) == 10) return 0;
                        if (Calc(Calc(a, x, Calc(b, y, c)), z, d) == 10) return 1;
                        if (Calc(Calc(a, x, b), y, Calc(c, z, d)) == 10) return 2;
                        if (Calc(a, x, Calc(Calc(b, y, c), z, d)) == 10) return 3;
                        if (Calc(a, x, Calc(b, y, Calc(c, z, d))) == 10) return 4;
                    }

            return -1;
        }

        private int Calc(int x, int type, int y)
        {
            switch (type)
            {
                case 0: return x + y;
                case 1: return x - y;
                case 2: return x * y;
                default: return 0;
            }
        }

        private string MakeString(int p)
        {
            switch (p)
            {
                case 0:
                    return string.Format("((({0} {1} {2}) {3} {4}) {5} {6})", a, op[x], b, op[y], c, op[z], d);
                case 1:
                    return string.Format("(({0} {1} ({2} {3} {4})) {5} {6})", a, op[x], b, op[y], c, op[z], d);
                case 2:
                    return string.Format("(({0} {1} {2}) {3} ({4} {5} {6}))", a, op[x], b, op[y], c, op[z], d);
                case 3:
                    return string.Format("({0} {1} (({2} {3} {4}) {5} {6}))", a, op[x], b, op[y], c, op[z], d);
                case 4:
                    return string.Format("({0} {1} ({2} {3} ({4} {5} {6})))", a, op[x], b, op[y], c, op[z], d);
                default:
                    return "0";
            }
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder();
            SearchCombination SC = new SearchCombination();

            while (true)
            {
                int[] input = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);

                if (input[0] == 0) break;

                SC.Solve(input);
                sb.AppendLine(SC.result);
            }
            Console.Write(sb);
        }
    }
}

Measured memory_bytes: 9032