Folding a Ribbon

Given the layer index and part index of a marked spot on a ribbon folded n times, output the unique sequence of left and right folds.

Medium7RecursionDivide and conquerMathSimulationNo attempts yetTime limit2sMemory limit512 MB

Problem

A very long and thin ribbon is folded over and over. At the start the ribbon lies flat from left to right. You crease it at its center and lay one half over the other. There are two ways to do it: pick up the left end and lay it over the right end, or pick up the right end and lay it over the left end. To fold an already folded ribbon, treat the whole pile of layers as one thicker ribbon and fold it again from the left or from the right.

After nn folds, one of the layers of the folded ribbon is marked, and then the ribbon is unfolded completely back to its original state. Many creases remain on the unfolded ribbon, and the mark sits in one part of the ribbon bounded by two creases, or by a crease and an end of the ribbon. Given which layer was marked and where the marked part lies on the unfolded ribbon, report the direction of every fold in order.

The figure below shows the case where n=3n = 3, the marked layer is the third from the top, and the marked part is the second from the left.

Folding a ribbon three times and unfolding it

Input

The input has at most 100 datasets. Each dataset is a line with three integers separated by spaces.

n i j

The three integers mean this. The ribbon is folded nn times in some order, and then the ii-th layer of the folded ribbon, counted from the top, is marked. When the ribbon is unfolded completely, the marked part is the jj-th part of the ribbon separated by creases, counted from the left. Both ii and jj are one based, so the topmost layer is layer 1 and the leftmost part is part 1. The integers satisfy 1n601 \le n \le 60, 1i2n1 \le i \le 2^n and 1j2n1 \le j \le 2^n.

The last line of the input holds three zeros. That line marks the end of the input and is not a dataset.

Output

For each dataset, print on one line a folding sequence that produces the described result.

The folding sequence is a string of nn characters, each L or R. L means a fold from the left to the right, and R means a fold from the right to the left. The folds are carried out in the order the characters appear. Exactly one folding sequence satisfies the given conditions.