#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; vector A(N), B(N); for(int i = 0; i < N; i++) cin >> A[i]; for(int i = 0; i < N; i++) cin >> B[i]; int ind = 0; queue> ans; stack s; for(int i = 0; i < N; i++){ if(A[i] > B[i]){ while(A[i] > B[i]){ ans.push({i + 1, 'L'}); A[i]--; } } else{ if(i != N - 1 && A[i + 1] <= B[i]){ s.push(i); } else{ while(A[i] < B[i]){ ans.push({i + 1, 'R'}); A[i]++; } } } } while(!s.empty()){ int now = s.top(); s.pop(); while(A[now] < B[now]){ ans.push({now + 1, 'R'}); A[now]++; } } cout << ans.size() << endl; while(!ans.empty()){ pair t = ans.front(); cout << t.first << ' ' << (char)t.second << endl; ans.pop(); } }