m = int(input()) for _ in range(m): A = int(input()) + 1 L = [] while A > 1: L.append(['R', 'L'][A % 2 == 0]) A = A // 2 print(''.join(L[::-1]))