m = int(raw_input()) for i in xrange(m): A = int(raw_input()) root = [] while A > 0: root.append("R" if A % 2 == 0 else "L") A = (A-1)/2 print " ".join(root)[::-1]