N=int(input()) A=list(map(int, input().split())) B=list(map(int, input().split())) ans=0 hand=[] for i in range(N): temp=abs(A[i]-B[i]) ans+=temp if A[i]>B[i]: hand.append((i+1,"L",temp)) else: hand.append((i+1,"R",temp)) print(ans) for i,w,cnt in hand: for _ in range(cnt): print(i,w)