m = int(input()) while m > 0: A = int(input()) + 1 s = '' while A > 1: if A % 2 == 0: s += 'L' else: s += 'R' A //= 2 print(s[::-1]) m -= 1