N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) desc = [] asc = [] ans = 0 for i in range(N): if A[i] <= B[i]: asc.append((i + 1, abs(A[i] - B[i]))) else: desc.append((i + 1, abs(A[i] - B[i]))) ans += abs(A[i] - B[i]) asc = asc[::-1] print(ans) for index, cnt in asc: for j in range(cnt): print(str(index) + ' R') for index, cnt in desc: for j in range(cnt): print(str(index) + ' L')