import Control.Monad as M main :: IO () main = do m <- readLn a <- M.replicateM m readLn putStr $ solve a solve :: [Int] -> String solve = unlines . reverse . foldl (\acc x -> solve' x "" : acc) [] where solve' :: Int -> String -> String solve' 0 x = x solve' n x | n `mod` 2 == 0 = solve' ((n `div` 2) - 1) ( 'R' : x ) | otherwise = solve' ((n - 1) `div` 2) ( 'L' : x )