N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) ans = [] left = 0 while left < N: right = left while right < N and A[right] < B[right]: right += 1 for i in reversed(range(left,right)): for j in range(A[i],B[i]): ans.append((i + 1,"R")) if right < N: for j in range(A[right],B[right],-1): ans.append((right + 1,"L")) left = right + 1 print(len(ans)) for k,c in ans: print(k,c)