from collections import deque N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) A.sort() B.sort() l = [] for i in range(N): l.append((A[i],B[i],i+1)) ans_list = [] que = deque([]) for i in range(N): a,b,n = l[i] if a < b: que.appendleft((a,b,n)) else: for _ in range(abs(a-b)): ans_list.append((n,'L')) for a,b,n in que: for _ in range(abs(a-b)): ans_list.append((n,'R')) print(len(ans_list)) for a,b in ans_list: print(a,b)