public static void main(String [] args)
    {
        Scanner scanner = null;
        try
        {
            scanner = new Scanner(new BufferedInputStream(System.in), CHARSET);
            AddLeftParenthesis alp = new AddLeftParenthesis();
            Stack<String> optStack = alp.getStack();
            Stack<String> numStack = alp.getStack();
            while (scanner.hasNext())
            {
                String s = scanner.next();
                if (s.equals("+") || s.equals("-") || s.equals("*") || s.equals("/"))
                {
                    optStack.push(s);
                }
                else if (s.equals(")"))
                {
                    String opt = optStack.pop();
                    String rightOptNum = numStack.pop();
                    String leftOptNum = numStack.pop();
                    String tmpResult = "( " + leftOptNum + " " + opt + " " + rightOptNum + " )";
                    numStack.push(tmpResult);
                }
                else
                {
                    numStack.push(s);
                }
            }
            System.out.println(numStack.pop());
        }
        finally
        {
            scanner.close();
        }
    }