N = gets.to_i A = gets.split(" ").map{|s| s.to_i} B = gets.split(" ").map{|s| s.to_i} q = [] c = Array.new((A+B).max, false) 0.upto(N-1) {|i| a, b = A[i], B[i] c[a-1] = true if a < b then q.unshift([i+1, a, b]) else q << [i+1, a, b] end } ans = [] while q.length > 0 do i, from, to = q.shift d = from < to ? 1 : -1 while from != to do ans << [i, d > 0 ? "R" : "L"] from += d end end puts ans.length ans.each {|i, d| puts "#{i} #{d}" }