VSHEOM-43
In the distant past, during the dawn of era 43, the children of LKSHen constructed a massive computing machine known as the Huge School Electronic Computing Machine, or HSECM-43. Today, countless generations later, a new group of LKSHen children has unearthed this ancestral marvel.
Recently, these children have been studying correct bracket sequences using round and square brackets. To test their understanding, they decided to list the first K correct bracket sequences in lexicographical order, each consisting of 2N brackets. Luckily, the rediscovered supercomputer can solve this problem. However, they found that the creators of HSECM-43 had a unique interpretation of lexicographical order, where brackets are arranged as shown in the image below:
Your task is to determine what the LKSHen children observed on the HSECM-43 screen.
Input
The input consists of two numbers: N (1 ≤ N ≤ 100) and K (1 ≤ K ≤ min(10000, 2^nC_n)).
Output
The output should contain K lines, each displaying one of the first K correct bracket sequences of length 2N, using round and square brackets, ordered lexicographically according to the specified order.