#include #include int main() { int i, j, N, A[200001], B[200001], ans = 0; scanf("%d", &N); for (i = 1; i <= N; i++) scanf("%d", &(A[i])); for (i = 1; i <= N; i++) scanf("%d", &(B[i])); for (i = 1; i <= N; i++) ans += abs(A[i] - B[i]); printf("%d\n", ans); for (i = 1; i <= N; i++) { while (A[i] != B[i]) { if (A[i] > B[i]) { printf("%d L\n", i); A[i]--; } else { for (j = i; j < N && A[j] == A[j+1] - 1; j++); printf("%d R\n", j); A[j]++; } } } fflush(stdout); return 0; }