from collections import deque M = int(input()) for _ in range(M): A = int(input()) C = deque() while A: C.appendleft('L' if A % 2 else 'R') A = (A - 1) // 2 print(*C, sep='')