#include <cstdio>
#include <iostream>
#include <cmath>
#include <ctype.h>
#include <string> 
#include <sstream>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
  
using namespace std;

int n, l;
int tunnel[101][2];
// tunnel[i][0]????????????i???????????¨???????????????????????????????????¨????????¢????????????

void solve()
{
    int leftnum = 0, t = 0;
    while(1){
        t++;
        // ???????????????????????????
        if(tunnel[l - 1][1] != 0){
            leftnum++;
            if(leftnum == n){
                cout << t << " " << tunnel[l - 1][1] << endl;
                return;
            }
            tunnel[l - 1][1] = 0;
        }
        for(int i = l - 2; i > 0; i--){
            tunnel[i + 1][1] = tunnel[i][1];
            tunnel[i][1] = 0;
        }
        // ???????????????????????????
        if(tunnel[1][0] != 0){
            leftnum++;
            if(leftnum == n){
                cout << t << " " << tunnel[1][0] << endl;
                return;
            }
            tunnel[1][0] = 0;
        }
        for(int i = 2; i < l; i++){
            if(tunnel[i][0] == 0) continue;
            if(tunnel[i - 1][1] != 0){
                tunnel[i - 1][0] = tunnel[i - 1][1];
                tunnel[i - 1][1] = tunnel[i][0];
            } else {
                tunnel[i - 1][0] = tunnel[i][0];
            }
            tunnel[i][0] = 0;
        }
    }
    return;
}

int main()
{
    while(1){
        cin >> n >> l;
        if(n == 0 && l == 0) break;
        for(int i = 0; i < l; i++){
            for(int j = 0; j < 2; j++){
                tunnel[i][j] = 0;
            }
        }
        char d;
        int p;
        for(int i = 0; i < n; i++){
            cin >> d >> p;
            if(d == 'L') tunnel[p][0] = i + 1;
            else tunnel[p][1] = i + 1;
        }
        solve();
    }
    return 0;
}