B. Grid Construction
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You want to create a grid with $$$\le 500$$$ rows and $$$\le 500$$$ columns, and then color each cell of the grid either red or blue.

Let's say your grid contains $$$n$$$ rows numbered $$$1, 2, \ldots n$$$ from top to bottom and $$$m$$$ columns numbered $$$1, 2, \ldots m$$$ from left to right. Let $$$(i, j)$$$ denote the cell with row number $$$i$$$ and column number $$$j$$$.

Consider a path from top left to bottom right $$$$$$(x_1 = 1, y_1 = 1), (x_2, y_2), \ldots (x_{n+m - 2}, y_{n+m - 2}), (x_{n + m - 1} = n, y_{n + m - 1} = m),$$$$$$ that goes either right or down, that is, for every $$$1 \lt i \le n + m - 1$$$, either $$$(x_i, y_i) = (x_{i-1}, y_{i-1} + 1)$$$ or $$$(x_i, y_i) = (x_{i-1}+1, y_{i-1})$$$. We call such a path almost red if at max $$$1$$$ of the $$$n + m - 1$$$ cells on the path is colored blue. Similarly, we such a path almost blue if at max one of the $$$n + m - 1$$$ cells on the path is colored red.

Your task is to construct a grid and its coloring such that:

  • There are exactly $$$P$$$ almost red paths from top left to bottom right going either right or down.
  • There are exactly $$$Q$$$ almost blue paths from top left to bottom right going either right or down.
Input
  • The first line contains $$$T$$$, the number of testcases. Then the testcases follow.
  • Each testcase consists of a single line containing two space separated integers $$$P$$$ and $$$Q$$$.

Constraints:

  • $$$1 \le T \le 10$$$
  • $$$0 \le P, Q \le 10^{18}$$$
Output

For each testcase, first print the number of rows and the number of columns, $$$n$$$ and $$$m$$$ on a new line. Then, print $$$n$$$ lines. The $$$i-$$$th line should contain a string describing the $$$i-$$$th row of the grid. The $$$j-$$$th character of this string should be R if the cell $$$(i, j)$$$ is colored red and B otherwise.

Example
Input
2
1 1
0 5
Output
2 2
RB
RB
3 4
BBBR
RBRR
BBBB
Note

In the output of the first testcase, there are two paths, the first being almost red and the second being almost blue:

  1. $$$(1, 1) \rightarrow (2, 1) \rightarrow (2, 2)$$$
  2. $$$(1, 1) \rightarrow (1, 2) \rightarrow (2, 2)$$$

In the output of the second testcase, there are no almost red paths. There are $$$5$$$ almost blue paths as required:

  1. $$$(1, 1) \rightarrow (2, 1) \rightarrow (3, 1) \rightarrow (3, 2) \rightarrow (3, 3) \rightarrow (3, 4)$$$
  2. $$$(1, 1) \rightarrow (2, 1) \rightarrow (2, 2) \rightarrow (3, 2) \rightarrow (3, 3) \rightarrow (3, 4)$$$
  3. $$$(1, 1) \rightarrow (1, 2) \rightarrow (2, 2) \rightarrow (3, 2) \rightarrow (3, 3) \rightarrow (3, 4)$$$
  4. $$$(1, 1) \rightarrow (1, 2) \rightarrow (2, 2) \rightarrow (2, 3) \rightarrow (3, 3) \rightarrow (3, 4)$$$
  5. $$$(1, 1) \rightarrow (1, 2) \rightarrow (1, 3) \rightarrow (2, 3) \rightarrow (3, 3) \rightarrow (3, 4)$$$