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 q << [i+1, a-1, b-a] if a != b } ans = [] while q.length > 0 do i, pos, diff = q.shift d = diff > 0 ? 1 : -1 if c[pos+d] then q << [i, pos, diff] else c[pos] = false while diff != 0 and (not c[pos+d]) do diff -= d pos += d ans << [i, d > 0 ? "R" : "L"] end c[pos] = true q << [i, pos, diff] if diff != 0 end end puts ans.length ans.each {|i, d| puts "#{i} #{d}" }