#include<iostream>
#include<algorithm>
using namespace std;


int main(){
	int n,l;
	char d[100];
	int x[100];
	while(cin>>n>>l,n|l){
		int count=0;
		int leave,t=0;
		for(int i=0;i<n;i++)cin>>d[i]>>x[i];
		while(count<n){
			for(int i=0;i<n;i++){
				if(x[i]==-1)continue;
				if(d[i]=='L')x[i]--;
				else x[i]++;
			}
			for(int i=0;i<n;i++){
				if(x[i]==-1)continue;
				for(int j=i+1;j<n;j++){
					if(x[j]==-1)continue;
					if(x[i]==x[j])swap(d[i],d[j]);
				}
			}
			leave=-1;
			for(int i=0;i<n;i++){
				if(x[i]==0||x[i]==l){
					count++;
					x[i]=-1;
					if(leave==-1 || d[leave]=='R')leave=i;
				}
			}
			t++;
		}
		cout<<t<<' '<<leave+1<<endl;
	}
	return 0;
}