Try to Solve

Remove unbalanced parentheses in a given expression.


Example
Input
Output
Input
Output

Input
Output
Input
Output