let doIt () = let stageNums = [| 0; 2; 6; 14; 30; 62; 126; 254; 510; 1022; 2046; 4094 |] let getPosition num = let stage = Array.findIndex (fun n -> n >= num) stageNums let pos = num - stageNums.[stage - 1] (pos, stageNums.[stage] - stageNums.[stage - 1]) let rec searchPath pos width path = if width <= 1 then path else let nextWidth = width / 2 let nextPos, nextPath = if pos <= nextWidth then pos, "L" else pos - nextWidth, "R" searchPath nextPos nextWidth (nextPath :: path) let doAm num = let pos, width = getPosition num let ans = searchPath pos width [] seq ans |> Seq.rev |> Seq.toArray |> fun arr -> System.String.Join ("", arr) let M = stdin.ReadLine () |> int let ASeq = seq { for _ in 1..M -> stdin.ReadLine () } |> Seq.map int ASeq |> Seq.map doAm |> Seq.iter (printfn "%s") doIt ()