for _ in range(int(input())): r = [] c = int(input()) while c: r.append("L" if c%2 else "R") c = (c-1)//2 print("".join(r[::-1]))