
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
using namespace std;
using LL = long long;

using P = pair<pair<int, bool>, int>;

pair<pair<int, int>, int>f(vector<P>vec, int l)
{
	vector<P>las = vec;
	if (vec.size() == 0)
	{
		return make_pair(make_pair(-1, -1), -1);
	}
	for (P& p : vec)
	{
		if (!p.first.second)
		{
			p.first.first = l - p.first.first;
		}
	}
	sort(vec.begin(), vec.end());
	int lef = 0, rht = vec.size() - 1;
	for (int i = 0; i < (int)vec.size() - 1; ++i)
	{
		if (vec[i].first.second)
		{
			lef++;
		}
		else
		{
			rht--;
		}
	}
	int ans1 = vec[vec.size() - 1].first.first;
	int ans2 = las[lef].second;
	bool dir = vec[vec.size() - 1].first.second;
	return make_pair(make_pair(ans1, dir), ans2);
}

int main(void)
{
	for (;;)
	{
		int n, l;
		cin >> n >> l;
		if (!n)break;
		vector<P>odd, evn;
		for (int i = 0; i < n; ++i)
		{
			char c; int v;
			cin >> c >> v;
			if (v % 2)
			{
				odd.push_back({ { v,c == 'L' } ,i + 1 });
			}
			else
			{
				evn.push_back({ { v,c == 'L' },i + 1 });
			}
		}
		auto p1 = f(odd, l);
		auto p2 = f(evn, l);
		if (p1.first > p2.first)
		{
			cout << p1.first.first << " " << p1.second << endl;
		}
		else
		{
			cout << p2.first.first << " " << p2.second << endl;
		}
	}
	return 0;
}