#include #define rep(i,n) for(int i=0;i<(int)(n);i++) #define chmin(x,y) x = min((x),(y)) #define chmax(x,y) x = max((x),(y)) #define popcount(x) __builtin_popcountll(x) using namespace std; using ll = long long ; using P = pair ; using pll = pair; const int INF = 1e9; const long long LINF = 1e17; const int MOD = 1000000007; //const int MOD = 998244353; const double PI = 3.14159265358979323846; int main(){ int n; cin >> n; vector a(n),b(n); rep(i,n) cin >> a[i]; rep(i,n) cin >> b[i]; queue q; auto ok = [&](int i) -> bool { if (!(0 <= i && i < n)) return false; if (a[i] == b[i]) { return true; } else if (a[i] < b[i]) { if (i == n-1 || b[i] < a[i+1]) return true; } else if (b[i] < a[i]) { if (i == 0 || a[i-1] < b[i]) return true; } return false; }; rep(i,n){ if (ok(i)) q.push(i); } vector> ans; while(!q.empty()){ int i = q.front(); q.pop(); while(a[i] < b[i]) {ans.emplace_back(i,'R'); ++a[i];} while(a[i] > b[i]) {ans.emplace_back(i,'L'); --a[i];} if (ok(i-1) && a[i-1] != b[i-1]) q.push(i-1); if (ok(i+1) && a[i+1] != b[i+1]) q.push(i+1); } cout << ans.size() << endl; for(auto [i,c]:ans) cout << i+1 << " " << c << endl; return 0; }