#include #include #include using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) int N; vector A; vector B; vector> ans; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cin >> N; A.resize(N); rep(i,N) cin >> A[i]; B.resize(N); rep(i,N) cin >> B[i]; rep(i,N) if(A[i] > B[i]){ while(A[i] != B[i]){ ans.push_back({i,'L'}); A[i]--; } } for(int i=N-1; i>=0; i--) if(A[i] < B[i]){ while(A[i] != B[i]){ ans.push_back({i,'R'}); A[i]++; } } cout << ans.size() << "\n"; for(auto a : ans){ cout << (a.first+1) << " " << a.second << "\n"; } return 0; }