m = int(input()) for _ in range(m): A_i = int(input()) ans = '' while A_i != 0: if A_i % 2 == 0: ans += 'R' else: ans += 'L' A_i = (A_i - 1) // 2 print(ans[::-1])