The Bird Tree

Time limit1sMemory limit128 MB

Problem

The Bird tree is an infinite binary tree. Every node holds one positive rational number, and the root holds $1/1$.

Writing bird for the whole tree, define two operations:

  • $\text{bird}+1$: the tree obtained by adding $1$ to every fraction in the tree.
  • $1/\text{bird}$: the tree obtained by replacing every fraction in the tree with its reciprocal.

The Bird tree is defined recursively. The root holds $1/1$; the root's left subtree is $1/(\text{bird}+1)$ and its right subtree is $1/\text{bird}+1$. In other words, the left subtree is the whole Bird tree with every fraction $x$ replaced by $\frac{1}{x+1}$, and the right subtree is the whole tree with every fraction $x$ replaced by $\frac{1}{x}+1=\frac{x+1}{x}$.

Remarkably, every positive rational number appears in this tree exactly once. Hence every reduced fraction has a unique path from the root to its node. A path is written with $L$ for moving to the left child and $R$ for moving to the right child. For example, $2/5$ is represented by the path $LRR$.

Given a reduced fraction, write a program that prints the path from the root to the node containing that fraction, using $L$ and $R$.

Input

The first line contains a reduced fraction in the form $a/b$, where $a$ is the numerator and $b$ is the denominator, separated by the character /. $a$ and $b$ are never both equal to $1$, and $\gcd(a, b) = 1$. ($1 \le a, b \le 10^9$) The length of the path does not exceed $10{,}000$.

Output

On the first line, print the path from the root to the node containing the given reduced fraction, as a string of $L$ and $R$.