#include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

struct ant {
	int id;
	bool goleft;
	int place;
};

struct attack {
	int id0;
	int id1;
	int time;
};

int main() {
	while (1) {
		int N, L; cin >> N >> L;
		if (!N)break;
		pair<int, int>ans(-1, -1);
		vector<ant>lants;
		vector<ant>rants;
		vector<pair<int, int>>ants;
		for (int i = 0; i < N; ++i) {
			char c; int a; cin >> c >> a;
			ants.push_back(make_pair(a, i));
			if (c == 'L') {
				lants.push_back(ant{ i,true,a });
				if (ans.first <= a) {
					ans = make_pair(a, i);
				}
			}
			else {
				rants.push_back(ant{ i,false,a });
				if (ans.first < L-a) {
					ans = make_pair(L-a, i);
				}
			}
		}
		sort(ants.begin(), ants.end());
		vector<int>perms(N);
		iota(perms.begin(), perms.end(), 0);
		/*for (int i = 0; i < ants.size(); ++i) {
			perms[i] = ants[i].second;
		}*/
		vector<attack>attacks;
		vector<vector<int>>times(lants.size(), vector<int>(rants.size(), -1));
		for (int l = 0; l < lants.size(); ++l) {
			for (int r = 0; r < rants.size(); ++r) {
				if (lants[l].place > rants[r].place) {
					if (!((lants[l].place - rants[r].place)%2)) {
						attacks.push_back(attack{ lants[l].id,rants[r].id,(lants[l].place-rants[r].place ) });
					}
				}
			}
		}
		sort(attacks.begin(), attacks.end(), [](const attack&l, const attack&r) {return l.time < r.time; });

		for (int i = 0; i < attacks.size(); ++i) {
			swap(perms[attacks[i].id0], perms[attacks[i].id1]);
		}
		cout <<  ans.first << " " << perms[ans.second]+1 << endl;
	}
	return 0;
}