In general, there are many ways to place pairs of parentheses correctly. For instance, these are just a few of the 42 ways for :
()()()()() ()(())(()) (()())()() (((()()))) ((((()))))
The following rules inductively define all the correct strings made up with parentheses:
The empty string is correct.
All correct non-empty strings are of the kind $\mbox{\texttt{(}}x \mbox{\texttt{)}}y$, where and are correct strings.
Let denote the length of a string . We can define as follows a total order among the correct strings with parentheses:
The empty string is smaller than any non-empty string.
Given two non-empty strings $s_1 = \mbox{\texttt{(}}x_1 \mbox{\texttt{)}}y_1$ and $s_2 = \mbox{\texttt{(}}x_2 \mbox{\texttt{)}}y_2$, is smaller than if and only if:
,
or and is smaller than ,
or , and is smaller than .
Can you write a program to compute the -th correct string with pairs of parentheses?
Input consists of several cases, each one with two numbers and . Assume and that is between 1 and the number of correct strings with pairs of parentheses.
For every case, print the -th correct string with 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
()()() ()(()) (())() (()()) ((())) (()(()))(()) ()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() (((())()(())(()))(()())((()()(()))()))(((())(((()(()))))())) (((((((((((((((((((((((((((((())))))))))))))))))))))))))))))