#include using namespace std; int n; int a[200000], b[200000]; vector c; vector d; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) cin >> b[i]; for (int i = 0; i < n; i++) { if (b[i] == a[i]) continue; if (b[i] < a[i]) { for (int j = 0; j < a[i] - b[i]; j++) { c.push_back(i + 1); d.push_back(0); } } if (b[i] > a[i]) { int t = i; while (t < n && b[t] > a[t]) t++; for (int j = t - 1; j >= i; j--) { for (int k = 0; k < b[j] - a[j]; k++) { c.push_back(j + 1); d.push_back(1); } } i = t - 1; } } cout << c.size() << endl; for (int i = 0; i < c.size(); i++) { cout << c[i]; if (d[i]) cout << " R" << endl; else cout << " L" << endl; } }