N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) cmd = [] for i in range(N): if A[i] >= B[i]: cmd.append(["L", A[i] - B[i], i + 1]) else: cmd.append(["R", B[i] - A[i], i + 1]) ans = [] stuck = [] for i in range(len(cmd)): if cmd[i][0] == "L": if stuck != []: for j in range(len(stuck)): c = stuck.pop(-1) for k in range(c[0]): ans.append([c[1], "R"]) stuck = [] for k in range(cmd[i][1]): ans.append([cmd[i][2], "L"]) else: stuck.append([cmd[i][1], cmd[i][2]]) if stuck != []: for j in range(len(stuck)): c = stuck.pop(-1) for k in range(c[0]): ans.append([c[1], "R"]) print(len(ans)) for i in range(len(ans)): print(*ans[i])