#include using namespace std ; typedef long long ll ; typedef pair P ; #define rep(i,n) for(int i = 0 ; i < n ; i++) #define rrep(i,a,b) for(int i = a ; i < b ; i++) int n ; int A[202020] , B[202020] ; bool dir[202020] ; queue que ; int main(){ cin >> n ; A[0] = -10101010 ; rep(i,n) cin >> A[i+1] ; rep(i,n) cin >> B[i+1] ; A[n + 1] = 10101010 ; int sum = 0 ; rrep(i,1,n+1) { dir[i] = (A[i] <= B[i]) ; sum += abs(A[i] - B[i]) ; que.push(i) ; } cout << sum << endl ; while(!que.empty()){ int i = que.front() ; que.pop() ; if(A[i] < B[i]){ while(A[i] + 1 != A[i + 1] && A[i] != B[i]){ A[i]++ ; cout << i << " " << 'R' << "\n" ; sum-- ; } } if(A[i] > B[i]){ while(A[i] - 1 != A[i - 1] && A[i] != B[i]){ A[i]-- ; cout << i << " " << 'L' << "\n" ; sum-- ; } } if(A[i] != B[i]) que.push(i) ; } }