def main(): N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) ctr = 0 ops = [] large_idx = -1 for idx in range(N): tmp_idx = idx if A[tmp_idx] >= B[tmp_idx]: ctr += A[tmp_idx] - B[tmp_idx] for cur in range(A[tmp_idx] - B[tmp_idx]): ops.append((tmp_idx, "L")) A[tmp_idx] = B[tmp_idx] continue if tmp_idx >= large_idx: large_idx = -1 for shift_idx in range(tmp_idx + 1, N): if A[shift_idx] >= B[shift_idx]: large_idx = shift_idx break else: large_idx = N for idx_2 in reversed(range(tmp_idx, large_idx)): ctr += B[idx_2] - A[idx_2] for _ in range(B[idx_2] - A[idx_2]): ops.append((idx_2, "R")) A[idx_2] = B[idx_2] print(ctr) for op_ in ops: print(op_[0] + 1, op_[1]) if __name__ == "__main__": main()