4139 - Bonus Treasure
Asia - Jakarta - 2008/2009
PDF Submit Ranking

 

In an archeology excavation in the Panda Land, the panda researchers found artifacts from the technologically advanced Bracket Panda civilization which lives around year 2008 BGP - Before Giant Panda. The artifacts are in the form of a big stone tablet with inscriptions on it (seems to be some kind of codes) and some locked treasure chests labeled as ``bonus" by the ancient pandas, each chest have numbers inscribed on them as well as several switches labeled with `(' and `)'.


After much research and decoding, the researchers found the following results:


For larger values of N , the master sequence's term can become extremely long as the term's length is in the order of 2N (as you may have figured out previously). Therefore as an elite programmer in Panda Land, you are given a task to write a program for decoding the combination codes - all that the program needs to do is printing the correct combination code required to open the treasure box, given the three numbers (N, K, M) inscribed on the treasure chest.

Input 

The input consists of several cases. Each case contains three integer: N (1$ \le$N$ \le$31) , K (0$ \le$K < 2N) and M (1$ \le$M$ \le$min{10000, 2N - K}) . The input is terminated by a line where N = K = M = 0 .

Output 

For each case, output the correct combination of code required to open it (which is the substring from the N -th master sequence term, with length M starting from the K + 1 -th character of the term.)

Sample Input 

3 0 6
3 4 4
3 5 2
3 6 1
3 7 1
0 0 0

Sample Output 

(()(() 
())) 
)) 
) 
)


Jakarta 2008-2009