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