Sofdor Ali and Bracket Sequence

Limits 500ms, 512 MB

Sofdor Ali has invented a new game. He asked his assistant Jong Bahadur ( who happens to be a monkey ) to play the game.

Here is how the game is played:

Sofdor Ali and Jong Bahadur went on a vacation. But they left the bracket sequences behind so that we could play with them. For this task, we will give you the sequence of brackets written by Sofdor Ali and you have to tell us the sequence found by Jong Bahadur.

A regular sequence of brackets is defined as follows:

Also notice that,

Input

The only line of input contains the sequence of brackets written by Sofdor Ali. The sequence is non-empty and its length doesn't exceed 105.

For 30% of the cases, the length of the sequence will not exceed 103.

Output

Output the lexicographically smallest regular bracket sequence that can be obtained by applying cyclic shift to the initial sequence. If there is no such sequence, output "-1" (without the quotation marks).

Samples

InputOutput
)()(()
(())()
InputOutput
((
-1

Explanation

For the first case, there were two possible cyclic shifts that obtained a regular sequence, ie: ()(()) and (())(). Among these two, (())() is lexicographically smaller.

For the second case, we have no cyclic shift that gets us a regular bracket sequence.