//#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

pair<char, int> t[1000][105][2];
int l;
bool check(int m) {
	bool flag = false;
	REP(i, l+1) {
		if(t[m][i][0] != MP('-', -1)) flag = true;
		if(t[m][i][1] != MP('-', -1)) flag = true;
	}
	return flag;
}

signed main(void)
{
	while(1) {
		int n;
		cin >> n >> l;
		if(!n && !l) break;
		REP(j, 1000) REP(i, l+1) t[j][i][0] = t[j][i][1] = {'-', -1};
		REP(i, n) {
			char c;
			int a;
			cin >> c >> a;
			t[0][a][0] = {c, i+1};
		}

		int j = 0, ans;
		while(check(j)) {
			ans = -1;
			REP(i, l+1) {
				//???????????¨
				if(t[j][i][0] != MP('-', -1)) {
					// Right
					if(t[j][i][0].first == 'R') {
						if(i+1 > l) {
						 	if(ans == -1) ans = t[j][i][0].second;
					 	} else if(t[j+1][i+1][0] == MP('-', -1)) {
							t[j+1][i+1][0] = t[j][i][0];
						} else {
							t[j+1][i+1][1] = t[j][i][0];
							if(t[j+1][i+1][1].first == 'R') t[j+1][i+1][1].first = 'L';
							else t[j+1][i+1][1].first = 'R';
							if(t[j+1][i+1][0].first == 'R') t[j+1][i+1][0].first = 'L';
							else t[j+1][i+1][0].first = 'R';
						}
					// Left
					} else {
						if(i-1 < 0) {
						 	ans = t[j][i][0].second;
					 	} else if(t[j+1][i-1][0] == MP('-', -1)) {
							t[j+1][i-1][0] = t[j][i][0];
						} else {
							t[j+1][i-1][1] = t[j][i][0];
							if(t[j+1][i-1][1].first == 'R') t[j+1][i-1][1].first = 'L';
							else t[j+1][i-1][1].first = 'R';
							if(t[j+1][i-1][0].first == 'R') t[j+1][i-1][0].first = 'L';
							else t[j+1][i-1][0].first = 'R';
						}
					}
				}
				//???????????¨
				if(t[j][i][1] != MP('-', -1)) {
					// Right
					if(t[j][i][1].first == 'R') {
						if(i+1 > l) {
						 	if(ans == -1) ans = t[j][i][1].second;
					 	} else if(t[j+1][i+1][0] == MP('-', -1)) {
							t[j+1][i+1][0] = t[j][i][1];
						} else {
							t[j+1][i+1][1] = t[j][i][1];
							if(t[j+1][i+1][1].first == 'R') t[j+1][i+1][1].first = 'L';
							else t[j+1][i+1][1].first = 'R';
							if(t[j+1][i+1][0].first == 'R') t[j+1][i+1][0].first = 'L';
							else t[j+1][i+1][0].first = 'R';
						}
					// Left
					} else {
						if(i-1 < 0) {
						 	ans = t[j][i][1].second;
					 	} else if(t[j+1][i-1][1] == MP('-', -1)) {
							t[j+1][i-1][0] = t[j][i][1];
						} else {
							t[j+1][i-1][1] = t[j][i][1];
							if(t[j+1][i-1][1].first == 'R') t[j+1][i-1][1].first = 'L';
							else t[j+1][i-1][1].first = 'R';
							if(t[j+1][i-1][0].first == 'R') t[j+1][i-1][0].first = 'L';
							else t[j+1][i-1][0].first = 'R';
						}
					}
				}
			}
			/*cout << "j:" << j << " ";
			REP(i, l+1) {
				cout << "(" << t[j][i][0].first << "," << t[j][i][0].second << ")(" << t[j][i][1].first << "," << t[j][i][1].second << ")";
			}
			cout << endl;*/
			j++;
		}
		cout << j-1 << " " << ans << endl;
	}

	return 0;
}

Measured memory_bytes: 4688