#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
char T; int l, a, b, x[1000], d[1000], M, N, y[1000], z[1000];
int main() {
	while (true) {
		M = 0;
		memset(y, 0, sizeof(y));
		cin >> b >> l; if (!l) { break; }
		for (int i = 1; i <= b; i++) {
			cin >> T >> x[i];
			if (T == 'L') { d[i] = 0; M = max(M, x[i]); }
			else { d[i] = 1; M = max(M, l - x[i]); }
		}
		N = 0;
		for (int i = 1; i <= M + 1; i++) {
			memset(z, 0, sizeof(z));
			for (int j = b; j >= 1; j--) {
				if (y[j] == 0) {
					if (d[j] == 0) {
						x[j]--;
					}
					else {
						x[j]++;
					}
					if (x[j]<0 || x[j]>l) {
						y[j] = 1;
					}
					else {
						z[x[j]]++;
					}
					if (M+1 == i) {
						if (N) {
							if (x[j] < 0) { N = j; }
						}
						else {
							N = j;
						}
					}
				}
			}
			for (int j = b; j >= 1; j--) {
				if (z[x[j]] >= 2) {
					if (d[j]) { d[j] = 0; }
					else { d[j] = 1; }
				}
			}
		}
		cout << M << ' ' << N << endl;
	}
}