import Control.Monad solve 1 = "L" solve 2 = "R" solve n | odd n = "L" ++ solve (n `div` 2) | otherwise = "R" ++ solve ((n - 1) `div` 2) main = do m <- readLn as <- replicateM m readLn mapM_ putStrLn $ map (reverse . solve) as