import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int[] org = new int[n]; for (int i = 0; i < n; i++) { org[i] = sc.nextInt(); } int[] next = new int[n]; int count = 0; for (int i = 0; i < n; i++) { next[i] = sc.nextInt(); count += Math.abs(org[i] - next[i]); } StringBuilder sb = new StringBuilder(); ArrayDeque stack = new ArrayDeque<>(); for (int i = 0; i < n; i++) { if (org[i] < next[i] && i < n - 1 && org[i + 1] <= next[i]) { stack.push(i); } else { move(i + 1, org[i], next[i], sb); while (stack.size() > 0) { int idx = stack.pop(); move(idx + 1, org[idx], next[idx], sb); } } } System.out.println(count); System.out.print(sb); } static void move(int stone, int from, int to, StringBuilder sb) { if (from > to) { for (int i = 0; i < from - to; i++) { sb.append(stone).append(" L\n"); } } else { for (int i = 0; i < to - from; i++) { sb.append(stone).append(" R\n"); } } } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }