{"raw_statement":[{"iden":"problem statement","content":"F Corporation is developing a robotic vacuum cleaner, Takahashi-kun cleaner. This robot works with a program of the following form, which consists of only basic commands and repetitions.\n\n#### Basic Commands\n\n*   `L`: Turn left by 90 degrees.\n*   `R`: Turn right by 90 degrees.\n*   `l`: If the robot is facing a wall, turn left by 90 degrees.\n*   `r`: If the robot is facing a wall, turn right by 90 degrees\n*   `F`: If the robot is not facing a wall, move forward one square.\n\n#### Repetitions\n\nBy writing a positive integer $k$ before a basic command, the basic command will be repeated $k$ times. For example, the program `RFFFFFFFFFF` can be shortened to `R10F`. Programs can be grouped by `()`. By writing a positive integer $k$ before a group, the program in the group will be repeated $k$ times. For example, the program `RFRFRFLRFRFRFL` can be shortened to `2(3(RF)L)`.\nThe floor to be cleaned is divided into $N\\times N$ squares and is surrounded by walls. There may also be walls between adjacent squares. Let $(0,0)$ denote the top-left square, and $(i,j)$ denote the square at the $i$\\-th row from the top and $j$\\-th column from the left. The robot starts cleaning in the square $(s_i,s_j)$ facing upward. The robot will clean all the visited squares, including the initial position.\nYour task is to output a short program that can clean all the squares. The robot takes one unit of time to execute one basic command, and the cleaning must be completed within $5000$ unit of time. If the output program does not finish in $5000$ unit time, it will be terminated after executing the $5000$th basic command. It also takes one unit of time to execute the basic command `l` or `r` without facing the wall, or to execute the basic command `F` with facing the wall. The robot will also clean the square that it moves to by the $5000$th basic command."},{"iden":"scoring","content":"Let $L$ be the number of characters in the output program, and $M$ be the number of squares that has been cleaned when the program execution is completed or terminated after $5000$ unit time. Note that $L$ is the number of characters, not the number of basic commands. For example, the program `100(RF)` executes the basic commands $200$ times, but the number of characters is $L=7$.\n\n*   If $L>10000$ or your output is not a valid program, your submission will be judged as WA\n*   If $M=N^2$, you will get a score of $N^2 + \\mathrm{round}(10^8/(100+L))$.\n*   If $M<N^2$, you will get a score of $M$.\n\nThere are 100 test cases, and the score of a submission is the total score for each test case. If you get a result other than AC for one or more test cases, the score of the submission will be zero. The highest score obtained during the contest time will determine the final ranking, and there will be no system test after the contest. If more than one participant gets the same score, the ranking will be determined by the submission time of the submission that received that score."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$s_i$ $s_j$\n$h_{0,0}$ $\\cdots$ $h_{0,N-2}$\n$\\vdots$\n$h_{N-1,0}$ $\\cdots$ $h_{N-1,N-2}$\n$v_{0,0}$ $\\cdots$ $v_{0,N-1}$\n$\\vdots$\n$v_{N-2,0}$ $\\cdots$ $v_{N-2,N-1}$\n\nWe fix $N=20$ for all test cases. $(s_i,s_j)$ represents the initial position of the robot and satisfies $0\\leq s_i, s_j\\leq N-1$.\n$h_{i,0}$ $\\cdots$ $h_{i,N-2}$ is a string of $N-1$ characters consisting of only $0$ or $1$. If there is a wall between the squares $(i,j)$ and $(i,j+1)$, then $h_{i,j}=1$, otherwise $h_{i,j}=0$. $v_{i,0}$ $\\cdots$ $v_{i,N-1}$ is a string of $N$ characters consisting of only $0$ or $1$. If there is a wall between the squares $(i,j)$ and $(i+1,j)$, then $v_{i,j}=1$, otherwise $v_{i,j}=0$. It is guaranteed that all squares are reachable from the initial position."},{"iden":"sample input 1","content":"14 18\n0000000000000010000\n0001000001000110100\n0010010001010101000\n0011100000110100010\n0011100000001001010\n0001011000001101000\n0010000000010100010\n0011001000000000100\n1101010010010100000\n1001010110000010100\n1001110101010010100\n0000101000101100101\n1010000100101010110\n0000101100100001110\n1001100100000000010\n0011000100010100011\n0010010000011001001\n1101010011001000000\n1011000001001001010\n0001000101000010100\n00101001010100000010\n00100001100111000101\n10000111000000010100\n00000001011000101000\n01000100011100010010\n11011001101100001101\n00101110101010111000\n00000000101000100111\n00101001011101010010\n00000010000110100010\n00110001010000001010\n01100000110000110000\n00011100000011000000\n01010000101101110010\n00100110001011010000\n10000100101000110100\n00100001100100001010\n00000101001101111001\n01000010000010000000"},{"iden":"sample output 1","content":"10(RlFlF)LFF2(3(RF)L)R10FRFR5FLFFFR4FR3FL3FR2FL2FLFFFLFFFRFFR3FRFRFFRFL2FL2FRFR2FL5FFFFFFFFFFL2FL2FR4FRFFL9FL2FRFRFFL3FL3FLFFFFFLFFL4FLFLFRFLFR2FRFRFL2FL3FLFR2FRFRFR2FLFFLFRFFR3FFFLFFFRFRFRFL2FR2FL3FRFL4FLFFR6FRFRFFFRFL4FFFLFL2FRRFL2FRR4FFRFRFR2FRFR2FLFFFR4FLFRF4FR9FRFFFFFFRFFLFL3FRFFLFL4FLFRFRFLFLFRFRFL2FLFLFLFRFR3FRFLFLLFR2FR3FFFLFFRFLFFL2FRFLFL4FLFLLFRFRFLFRF2FL4FLFRFLFLFRR2FL3FRFFRFRFLFFFRFLFLFRFFLFFLFLFR4FRFFRFRFLFFLL2FR2FFRFFFFRFRFLFR2FRFRFRFL2FFR8FR2FRFFRF2FR3FRFLFR2FRFRFL2F2FFLFLFRF2FRFL5FRFLL4FRFLFFL2FRFRFL2FRFL4FL4FLFRFFLFL2FRR3FFRFFRFRFFR2FLFL2FRFRFRFL2FL7FR2FLFFLLFL3FRFLFLFFFFFL4FLFRFLFLFFR5FL2FLFRFR3FLFL7FL2FLF2FLFL4FLFR2FL3FR2FFRFFRFRFRR3FR2FLFR11FR3FLFRFRFL2FL3FRFL2FLFLFRFL2FRFLLFL3FLFLFRFFL2FLFRFLFRFLFLFRRFRFLFL4FRFLFR2FLFLFRF2FLFRFL4FR2FLFR2FRFLFRFRFL2F"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}