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((j,"R")) if right < N: for j in range(A[right],B[right],-1): ans.append((j,"L")) left = right print(len(ans)) for k,c in ans: print(k,c)