while true do
  i, j = gets.split(' ').map(&:to_i)
  break if i == 0 && j == 0
  arr = []
  i.times { arr.push(gets.split(' ')) }

  data_array = arr.each_with_index.map do |e, index|
    p = e[1].to_i
    time, direction = e[0] == 'R' ? [j-p, 1] : [p, -1]
    {direction: direction, time: time, index: index + 1, position: p}
  end
  max_time = data_array.map{|x| x[:time]}.max

  a_d = data_array.select{|data| data[:time] == max_time}.map{|data| data[:direction]}.inject(1, :*)
  additional_array = data_array.each_with_index.map do |e, index|
    left_count = index==0 ? 0 : data_array[0..index-1].select{|el| el[:direction] == 1 && (el[:position]-e[:position]).even?}.count
    right_count = index==data_array.count-1 ? 0 : data_array[index+1..-1].select{|el| el[:direction] == -1  && (el[:position]-e[:position]).even?}.count
    e[:exit_direction] = left_count==right_count ? e[:direction] : left_count - right_count
    e
  end
  ans_array = additional_array.select{|data| data[:exit_direction]*a_d==1 && (a_d==-1 && (data[:position]-max_time).even? || a_d==1 && (j-data[:position]-1).even?) }
  ans_index = a_d == 1 ? ans_array[0][:index] : ans_array[-1][:index]
  puts "#{max_time} #{ans_index}"
end