#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef pair<int,int>P;

int d[20],p[20];
char s[2];
int main(){
	int n,l;
	while(scanf("%d%d",&n,&l),n){
		vector<P>v;
		rep(i,n){
			scanf("%s%d",s,&p[i]);
			if(s[0]=='L')d[i]=-1;
			else d[i]=1;
			v.push_back(P(p[i],i));
		}
		int cnt=0,a;
		while(!v.empty()){
			cnt++;
			vector<P>u;
			int A=-1;
			rep(i,v.size()){
				P p=v[i];
				p.first+=d[p.second];
				if(p.first==0||p.first==l){
					if(A==-1||p.first==0)A=p.second;
					continue;
				}
				u.push_back(p);
			}
			a=A;
			sort(u.begin(),u.end());
			rep(i,int(u.size())-1){
				if(u[i].first==u[i+1].first){
					d[u[i].second]=-d[u[i].second];
					d[u[i+1].second]=-d[u[i+1].second];
				}
			}
			v=u;
		}
		printf("%d %d\n",cnt,a+1);
	}
}