Parenthesis#1801

Parenthesis

1 second
64 megabytes
Very easy

To a computer, there is no difference between the expressions (((x)+(y))(t)) and (x+y)t; but for a human, the latter is easier to read. When expressions are automatically generated for humans, they should contain the minimal number of parentheses for the simplest perception. We assume that expressions consist of only two operations: addition () and multiplication (juxtaposition), and that these operations act only on single lowercase letter variables. Consider the grammar for an expression E:

E : P | P '+' E
P : F | F  P
F : V | '(' E ')'
V : 'a' | 'b' | .. | 'z'

The addition (, as in x+y) and multiplication (juxtaposition, as in ) operators are associative: x+(y+z)=(x+y)+z=x+y+z and x(yz)=(xy)z=xyz. Commutativity and distributivity of these operations should not be assumed. Parentheses have the highest precedence, followed by multiplication and then addition.

Input

The input consists of several cases. Each case is given on one line and is an expression that satisfies the grammar above. Each expression contains at most characters.

Output

For each test case, print on a separate line the same expression with all unnecessary parentheses removed.

Examples

Example 1

Loading
Loading