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