#include <bits/stdc++.h>
using namespace std;

int main () 
{
    int num_ant, length;
    
    while (1)
    {
        std::cin >> num_ant >> length;
        
        if (num_ant == 0 && length == 0) break;
        
        int direction[num_ant];
        int position[num_ant];
        char temp;
        int  tag;
        
        // input
        for (int i = 0; i < num_ant; i++)
        {
            std::cin >> temp >> position[i];
            if (temp == 'R') direction[i] = 1;
            else direction[i] = -1;
        }
        
        // simulate
        bool goal[110] = {0};
        bool flag = false;
        int t = 0;
        
        while (!flag)
        {
            t++;
            int conflict[110] = {0};
            int point[110] = {0};
            flag = true;
            
            for (int j = 0; j < num_ant; j++) 
            {
                if (goal[j] == false)
                {
                    position[j] += direction[j];
                    
                    if (conflict[position[j]] != 0)
                    {
                        direction[j] *= -1;
                        direction[point[position[j]]] *= -1;
                    }
                    else
                    {
                        conflict[position[j]]++;
                        point[position[j]] = j;
                    }
                    
                    if (position[j] == 0 || position[j] == length)
                    {
                        goal[j] = true;
                        if (position[j] == 0 )
                        {
                            tag = j;
                        }
                        else if (position[j] == length && conflict[0] == 0)
                        {
                            tag = j;
                        }
                    }
                }
            }
            
            // confirming
            for (int k = 0; k < num_ant; k++) 
            {
                if (goal[k] != true) flag = false;
            }
            
        }
        
        std::cout << t << " " << tag + 1 << std::endl;
    }
    
    return 0;
}
