m = int(input()) for _ in range(m): A = int(input()) S = "" while A != 0: B = A A = (A - 1) // 2 if A * 2 + 1 == B: S += "L" else: S += "R" print(S[::-1])