import Control.Applicative ((<$>)) import Control.Monad (replicateM) import Data.List (unfoldr) main :: IO () main = do m <- readLn solve <$> replicateM m readLn >>= mapM_ putStrLn solve :: [Int] -> [String] solve = map f where f = reverse . unfoldr g where g x | x == 0 = Nothing | otherwise = Just (if even x then 'R' else 'L', (x-1) `div` 2)