In general, there are many ways to place n pairs of parentheses correctly. For instance, these are just a few of the 42 ways for n = 5:
The following rules inductively define all the correct strings made up with parentheses:
Let | s | denote the length of a string s. We can define as follows a total order among the correct strings with parentheses:
Can you write a program to compute the i-th correct string with n pairs of parentheses?
Input
Input consists of several cases, each one with two numbers i and n. Assume 0 ≤ n ≤ 30 and that i is between 1 and the number of correct strings with n pairs of parentheses.
Output
For every case, print the i-th correct string with n pairs of parentheses.
Input
1 3 2 3 3 3 4 3 5 3 70 6 1 0 1 30 2000000000000000 30 3814986502092304 30
Output
()()() ()(()) (())() (()()) ((())) (()(()))(()) ()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() (((())()(())(()))(()())((()()(()))()))(((())(((()(()))))())) (((((((((((((((((((((((((((((())))))))))))))))))))))))))))))