For a given number and a given number , a sequence of parentheses is said to be good if it has a length of and exactly correctly parenthesized subsequences.
Task
Given and , print a good sequence of parentheses. If it does not exist, print -1
. Since this is too easy for you, you will have to do this times.
Input data
The first line contains a number , representing the number of tests. On the -th line, there will be two numbers and , representing the input data for the -th case.
Output data
On the -th line, print -1
or a good sequence of parentheses for the -th case.
Constraints and clarifications
- The printed sequence does not need to be correctly parenthesized.
- A sequence is called correctly parenthesized if and only if characters
+
and1
can be inserted such that the obtained sequence represents a correct mathematical expression. For example,(())
and()(())
are correctly parenthesized sequences because(1+(1+1))
and(1+1)+(1+(1+1))
are correct mathematical expressions, but(()
and())(()
are not correctly parenthesized sequences.
Example
stdin
3
6 4
2 4
4 2
stdout
()(())
-1
(())
Explanation
For the first case, the correctly parenthesized subsequences are ()(())
, ()
(first two characters), (())
, and ()
(fourth and fifth characters).
For the second case, it can be shown that there is no solution.
For the third case, the correctly parenthesized subsequences are ()
and (())
.