F. RBS Game
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

This is an interactive problem.

Alice and Bob are playing a bracket game with a sequence $$$s$$$. Initially, $$$s$$$ is empty. The game lasts for $$$n$$$ rounds in total.

In the $$$i$$$-th turn:

  • If $$$i$$$ is odd, Alice adds exactly $$$a$$$ brackets (left or right bracket) to the back of $$$s$$$;
  • Otherwise, Bob adds exactly $$$b$$$ brackets (left or right bracket) to the back of $$$s$$$.

After $$$n$$$ rounds, if $$$s$$$ is a regular bracket sequence, Alice wins. Otherwise, Bob wins.

It is guaranteed that $$$n$$$ is odd and both $$$a$$$ and $$$b$$$ are even.

A bracket sequence is called regular if it can be constructed by the following formal grammar.

  1. The empty sequence $$$\varnothing$$$ is regular.
  2. If the bracket sequence $$$A$$$ is regular, then $$$\mathtt{(}A\mathtt{)}$$$ is also regular.
  3. If the bracket sequences $$$A$$$ and $$$B$$$ are regular, then the concatenated sequence $$$A B$$$ is also regular.

For example, the sequences "(())()", "()", "(()(()))", and the empty sequence are regular, while "(()" and "(()))(" are not.

Choose to be Alice or Bob, and play the game with the jury.

Input

Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 25$$$). The description of the test cases follows.

Interaction

The first line of each test case contains three integers $$$n$$$, $$$a$$$, and $$$b$$$ ($$$3 \le n \le 49$$$, $$$2 \le a,b \le 50$$$). It is guaranteed that $$$n$$$ is odd and both $$$a$$$ and $$$b$$$ are even.

To choose to be Alice or Bob, you need to print an integer $$$x$$$ $$$(0 \le x \le 1)$$$, where $$$x=1$$$ means you choose Alice, and $$$x=0$$$ means you choose Bob.

If you choose to be Alice, you need to output a string containing exactly $$$a$$$ brackets in each $$$i$$$-th turn, where $$$i$$$ is odd. And read Bob's string containing exactly $$$b$$$ brackets in each $$$i$$$-th turn, where $$$i$$$ is even.

If you choose to be Bob, you need to output a string containing exactly $$$b$$$ brackets in each $$$i$$$-th turn, where $$$i$$$ is even. And read Alice's string containing exactly $$$a$$$ brackets in each $$$i$$$-th turn, where $$$i$$$ is odd.

After printing a query or the answer for a test case, do not forget to output the end of line and flush the output. Otherwise, you will get the verdict Idleness Limit Exceeded. To do this, use:

  • fflush(stdout) or cout.flush() in C++;
  • System.out.flush() in Java;
  • flush(output) in Pascal;
  • stdout.flush() in Python;
  • see the documentation for other languages.

Hacks

To hack, follow the test format below.

The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10$$$).

The first line of each test case contains three integers $$$n$$$, $$$a$$$, and $$$b$$$ ($$$3 \le n \le 49$$$, $$$2 \le a,b \le 50$$$).

It must be guaranteed that $$$n$$$ is odd and both $$$a$$$ and $$$b$$$ are even.

Example
Input
2
3 2 2


)(

3 4 2

()()

()
Output


1
((

))

0

)(
Note

In the first test case, $$$n=3$$$, $$$a=2$$$, and $$$b=2$$$. And you choose to be Alice.

  1. In the first turn, you (Alice) add "((" to the back of $$$s$$$. Currently, $$$s=$$$ "((".
  2. In the second turn, the jury (Bob) adds ")(" to the back of $$$s$$$. Currently, $$$s=$$$ "(()(".
  3. In the third turn, you (Alice) add "))" to the back of $$$s$$$. Currently, $$$s=$$$ "(()())".

Because $$$s=$$$ "(()())" is a regular bracket sequence, you win this game.

Note that the example is only for understanding the statement and does not guarantee that the strategies of both players are optimal.