U = 10 ** 7 N = int(input()) A = [-1] + list(map(int, input().split())) + [U] B = [-1] + list(map(int, input().split())) + [U] answer = [] i = 0 while i <= N: while i <= N and A[i] == B[i]: i += 1 # 左寄せ while i <= N and A[i] > B[i]: answer.append((i, B[i] - A[i])) i += 1 while i <= N and A[i] == B[i]: i += 1 # 右寄せ tmp = [] while i <= N and A[i] < B[i]: tmp.append((i, B[i] - A[i])) i += 1 answer.extend(tmp[::-1]) ans = [] cnt = 0 for i, d in answer: if d > 0: direction = "R" else: d = -d direction = "L" cnt += d ans.extend( ["{} {}".format(i, direction)] * d ) print(len(ans)) print("\n".join(ans))