N = int(input()) A = list(map(int, input().split())) + [10 ** 9] B = list(map(int, input().split())) stack = [] ans = [] for i in range(N): now_pos = A[i] to_pos = B[i] move = abs(now_pos - to_pos) if A[i + 1] > to_pos: if now_pos < to_pos: direction = "R" else: direction = "L" for _ in range(move): ans.append((i + 1, direction)) while stack: ind, move = stack.pop() for _ in range(move): ans.append((ind + 1, "R")) else: stack.append((i, move)) print(len(ans)) for row in ans: print(*row)