import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(2*10**5+10) write = lambda x: sys.stdout.write(x+"\n") debug = lambda x: sys.stderr.write(x+"\n") writef = lambda x: print("{:.12f}".format(x)) def runlength(s): if not s: return [] c = s[0] v = 1 n = len(s) l = [] for i in range(1, n): if c==s[i]: v += 1 else: l.append((c,v)) c = s[i] v = 1 l.append((c,v)) return l n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) lr = [0]*n for i in range(n): if a[i]b[i]: lr[i] = -1 ans = [] res = runlength(lr) i = 0 for c,v in res: if c==0: pass elif c==-1: for j in range(i, i+v): for _ in range(abs(a[j]-b[j])): ans.append(f"{j+1} L") else: for j in range(i, i+v)[::-1]: for _ in range(abs(a[j]-b[j])): ans.append(f"{j+1} R") i += v print(len(ans)) write("\n".join(ans))