def scc(E): n = len(E) iE = [[] for _ in range(n)] for i, e in enumerate(E): for v in e: iE[v].append(i) T = [] done = [0] * n # 0 -> 1 -> 2 ct = 0 for i0 in range(n): if done[i0]: continue Q = [~i0, i0] while Q: i = Q.pop() if i < 0: if done[~i] == 2: continue done[~i] = 2 T.append(~i) ct += 1 continue if i >= 0: if done[i]: continue done[i] = 1 for j in E[i]: if done[j]: continue Q.append(~j) Q.append(j) done = [0] * n SCC = [] ### ID が必要なとき I = [0] * n ### for i0 in T[::-1]: if done[i0]: continue L = [] Q = [~i0, i0] while Q: i = Q.pop() if i < 0: if done[~i] == 2: continue done[~i] = 2 L.append(~i) ### I[~i] = len(SCC) ### continue if i >= 0: if done[i]: continue done[i] = 1 for j in iE[i]: if done[j]: continue Q.append(~j) Q.append(j) SCC.append(L) return SCC, I N = int(input()) A = [int(a) for a in input().split()] B = [int(a) for a in input().split()] ans = sum([abs(a - b) for a, b in zip(A, B)]) X = [[] for _ in range(N)] for i in range(N - 1): if B[i] >= A[i+1]: X[i+1].append(i) if B[i+1] <= A[i]: X[i].append(i + 1) L, I = scc(X) print(ans) ANS = [] for a in L: i = a[0] if B[i] > A[i]: ANS += [str(i + 1) + " R"] * (B[i] - A[i]) elif B[i] < A[i]: ANS += [str(i + 1) + " L"] * (A[i] - B[i]) print("\n".join(ANS))