#include <iostream>
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
using namespace std;
int cou;
int n,l;
struct ant{
  bool toRight;
  int position;
};
ant ants[20];
int main() {
  while(true){
    cin >> n >> l;
    if(n==0&&l==0) return 0;
    rep(i,n){
      ants[i] = ant();
      char c;
      cin >> c;
      if(c=='R'){
        ants[i].toRight = true;
      }else{
        ants[i].toRight = false;
      }
      cin >> ants[i].position;
    }
    cou = n;
    int leftout;
    int rightout;
    for(int t = 1;true;t++){
      leftout = -1;
      rightout = -1;
      rep(i,n){
        if(ants[i].position==0||ants[i].position==l) continue;
        if(ants[i].toRight){
          ants[i].position++;
        }else{
          ants[i].position--;
        }
        if(ants[i].position==0){
          cou--;
          leftout = i;
        }
        if(ants[i].position==l){
          cou--;
          rightout = i;
        }
      }
      if(cou==0){
        if(leftout!=-1){
          cout << t << " " << leftout+1 << endl;
        }else{
          cout << t << " " << rightout+1 << endl;
        }
        break;
      }
      rep(i,n){
        if(ants[i].position==0||ants[i].position==l) continue;
        REP(j,i+1,n){
          if(ants[i].position==ants[j].position){
            ants[i].toRight = !ants[i].toRight;
            ants[j].toRight = !ants[j].toRight;
          }
        }
      }
    }
  }
  return 0;
}