#include <bits/stdc++.h>

#define ALL(a) (a).begin(), (a).end()
#define ll long long

using namespace std;

bool play(vector<set<int> > &m){
	for(auto e : m)if(e.size() != 0)return true;
	return false;
}

signed main(){
	while(true){
		int n,l; cin >> n >> l;
		if(n == 0)break;
		vector<int> d(n), p(n);
		vector<set<int> > m(l);
		for(int i = 0; i < n; i++){
			char tmp;
			cin >> tmp >> p[i];
			d[i] = tmp == 'R' ? 1 : -1;
			p[i]--;
			m[p[i]].insert(i);
		}
		int last = -1, cnt = 0;
		while(play(m)){
			for(int i = 0; i < l; i++){
//				for(auto e : m[i])cerr << e << ":";
//				cerr << "---";
			}
//			cerr << endl;
			vector<set<int> > next(l);
			for(int i = l-1; i >= 0; i--){
				for(auto e : m[i]){
					if(0 <= i+d[e] && i+d[e] < l-1){
//						cerr << i << ":" << e << "->" << (i+d[e]) << endl;
						next[i+d[e]].insert(e);
					}
					else if(i+d[e] >= l-1){
						last = e;
					}
					else{
						last = e;
					}
				}
			}
			for(int i = 0; i < l; i++){
//				for(auto e : next[i])cerr << e << ":";
//				cerr << "---";
				assert(next[i].size() <= 2);
				if(next[i].size() == 2){
					for(auto e : next[i])d[e] *= -1;
				}
			}
//			cerr << endl;
			swap(next, m);
			cnt++;
		}
		cout << cnt << " " << (last+1) << endl;
					


				
			
	}

	return 0;
}


