#include using namespace std; int main(){ int N; cin >> N; vector A(N), B(N); for(int& a : A) cin >> a; for(int& b : B) cin >> b; cout << transform_reduce(A.begin(), A.end(), B.begin(), 0, plus{}, [](int x, int y){ return abs(x - y); }) << endl; for(int i = 0; i < N; i++) while(A[i] > B[i]){ cout << i + 1 << " L\n"; A[i]--; } for(int i = N; i--; ) while(A[i] < B[i]){ cout << i + 1 << " R\n"; A[i]++; } }