from collections import deque N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) Pos = [0]*(2*N+1) for i in range(N): Pos[i+1] = A[i] Pos[N+i+1] = B[i] G = {i:[] for i in range(1,N+1)} Indeg = {i:0 for i in range(1,N+1)} for i in range(1,N+1): if Pos[i]<=Pos[N+i]: if i>1 and Pos[i]<=Pos[N+i-1]<=Pos[N+i]: G[i].append(i-1) Indeg[i-1] += 1 else: if i=Pos[x]: for j in range(Pos[i]-Pos[x]): ans.append((x,"R")) else: for j in range(Pos[x]-Pos[i]): ans.append((x,"L")) if G[x]: que.append(G[x][0]) print(len(ans)) for i,d in ans: print(i,d)