--リジャッジで落ちたコードのputStrLnをputStrに変更 -- Try yukicoder -- author: Leonardone @ NEETSDKASU main = putStrLn . unlines . solve . map read . tail . lines =<< getContents solve x = map (foo "") x where foo s 0 = s foo s x | z == 0 = foo ('R' : s) (y - 1) | otherwise = foo ('L' : s) y where (y, z) = divMod x 2