#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <functional>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define SQ(x) ((x)*(x))
#define Mod(x, mod) (((x)+(mod)%(mod))
#define MP make_pair
#define PB push_back
#define Fi first
#define Se second
#define INF (1<<29)
#define EPS 1e-10
#define MOD 1000000007

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;


int lant[128], rant[128];

int main()
{
  int n, l;
  while(1){
    cin >> n >> l;
    if(n == 0 && l == 0) break;
    memset(lant, -1, sizeof(lant));
    memset(rant, -1, sizeof(rant));    
    int d[32];
    int res = 0, ant = 0;
    rep(i, n){
      string s; int p;
      cin >> s >> p;
      if(s == "L") lant[p] = i;
      else rant[p] = i;
    }

    rep(time, l){
      for(int i=l;i>0;i--){
	if(rant[i] != -1 && lant[i] != -1){
	  swap(rant[i], lant[i]);
	}
	if(i==l-1 && rant[i] != -1){
	  res = time;
	  ant = rant[i]; rant[i] = -1;
	  //	  cout << time << " " << ant << endl;
	  continue;
	}
	rant[i+1] = rant[i]; rant[i] = -1;
      }

      for(int i=1;i<=l;i++){
	if(i==1 && lant[i] != -1){
	  res = time;
	  ant = lant[i]; lant[i] = -1;
	  //	  cout << time << " " << ant  << endl;
	  continue;
	}
	lant[i-1] = lant[i]; lant[i] = -1;
      }
    }
    cout << res+1 << " " << ant+1 << endl;
  }
  return 0;
}