#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

// #define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
// ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
// ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int n,l;
char d[250];
int p[250];
bool goal[250];

int main(){
	while(1){
		int n,l;
		int ll,rr;
		cin >> n >> l;
		if(n==0&&l==0) break;
		REP(i,n){
			cin >> d[i] >> p[i];
			goal[i] = false;
		}
		int rest = n;
		int goaltime = 0;
		while(rest!=0){
			goaltime++;
			vector<int> posd[500];
			REP(i,500) posd[i].clear();
			REP(i,n){
				//if(p[i]!=-1) cout << i << " " << d[i] << " " << p[i] << endl;
			}
			REP(i,n){
				if(goal[i]) continue;
				if(p[i]<=0||p[i]==l) continue;
				if(d[i]=='L') p[i]--;
				else p[i]++;
				if(p[i]>=0) posd[p[i]].pb(i);
			}
			FOR(i,1,l){
				if(posd[i].size()==2){
 					swap(d[posd[i][1]],d[posd[i][0]]);
				}
			}
			ll = -1; rr = -1;
			REP(i,n){
				if(p[i]==0){
					p[i]=-1;
					ll = i;
					rest--;
				}
				if(p[i]==l){
					p[i]=-1;
					rest--;
					rr = i;
				}
			}
		}
		int ans;
		if(ll==-1&&rr!=-1) ans = rr;
		else if(ll!=-1&&rr==-1) ans = ll;
		else ans = ll;
		cout << goaltime << " " << ans+1 << endl;

	}
}