#![allow(unused_imports)] use std::cmp::*; use std::collections::*; use std::io::Write; use std::ops::Bound::*; #[allow(unused_macros)] macro_rules! debug { ($($e:expr),*) => { #[cfg(debug_assertions)] $({ let (e, mut err) = (stringify!($e), std::io::stderr()); writeln!(err, "{} = {:?}", e, $e).unwrap() })* }; } fn main() { let n = read::(); let mut a = read_vec::(); let b = read_vec::(); let mut indexes = (0..n).collect::>(); indexes.sort_by_key(|&i| (a[i] - b[i]).abs()); let mut opes = vec![]; for idx in indexes { while (a[idx] - b[idx]).abs() > 0 { if a[idx] > b[idx] { opes.push((idx, "L")); a[idx] -= 1; } else { opes.push((idx, "R")); a[idx] += 1; } } } for (i, dir) in opes { println!("{} {}", i + 1, dir); } } fn read() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() } fn read_vec() -> Vec { read::() .split_whitespace() .map(|e| e.parse().ok().unwrap()) .collect() }