#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,l;
	while(1){
		cin>>n>>l;	if(n==0)break;
		vector<pair<char,int>>A(n);
		for(int i=0;i<n;i++){
			cin>>A[i].first>>A[i].second;
		}

		int ans=0,num=0,time=0;;
		bool flag=true;
		while(flag){
			++time;	flag=false;
			for(int i=0;i<n;i++){
				if(A[i].second==-1)continue;
				// move
				flag=true;
				if(A[i].first=='R')A[i].second++;
				else A[i].second--;
			}

			for(int i=0;i<n;i++){
				// check
				if(0<A[i].second && A[i].second<l){
					for(int j=0;j<n;j++){
						if(i==j)continue;
						else if(A[i].second==A[j].second){
							//printf("%d: (%d,%d)\n",A[i].second,i+1,j+1);
							if(A[i].first=='R')A[i].first='L';
							else A[i].first='R';

							break;
						}
					}
				}else if(A[i].second==0){
					A[i].second=-1;
					ans=time;
					num=i+1;
				}else if(A[i].second==l){
					A[i].second=-1;
					if(ans!=time){
						ans=time;
						num=i+1;
					}
				}
			}
		}
		cout<<ans<<" "<<num<<endl;
	}

	return 0;
}

