Limits 1s, 512 MB

This problem is matching brackets, but with regular expression.

Given a set of parenthesis, if they are balanced, print it. If not, leave the output empty.

Input

A line with a set of opening and closing parentheses. There will be at most 200 parenthesis.

Output

If the entire set of parentheses is balanced, the output should contain the entire set of parentheses. Otherwise, the output should be empty.

Samples

InputOutput
(())
(())
InputOutput
()()
()()

Submit

Login to submit.

Statistics

57% Solution Ratio
jackal_1586Earliest, Jan '23
Kuddus.6068Fastest, 0.0s
nusuBotLightest, 4.9 MB
jackal_1586Shortest, 24B
Toph uses cookies. By continuing you agree to our Cookie Policy.