mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) A.append(10**7) B.append(10**7) N += 1 st = [] ans = [] S = 0 for i in range(N): a = A[i] b = B[i] S += abs(a - b) if a < b: st.append((i+1, b - a)) else: while st: k, x = st.pop() ans.append((k, "R", x)) ans.append((i+1, "L", a - b)) print(S) for k, s, x in ans: for _ in range(x): print(k, s) if __name__ == '__main__': main()