#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int N,L,c,r,ra,D[100];
queue<int>q[2][105],w;
int main()
{
	for(;scanf("%d%d\n",&N,&L),N;)
	{
		r=-1;
		c=N;
		for(int i=0;i<N;i++)
		{
			int t;
			char d;
			scanf("%c%d\n",&d,&t);
			q[0][t].push(i);
			D[i]=d=='R'?1:-1;
		}
		for(int time=0;c>0;time++)
		{
			int f=time%2,nf=f^1;
			for(int i=0;i<=L;i++)
			{
				while(!q[f][i].empty())
				{
					int p=q[f][i].front();q[f][i].pop();
					if(i+D[p]<0||i+D[p]>L)
					{
						c--;
						if(r<time)
						{
							r=time;
							ra=p+1;
						}
					}
					else
						q[nf][i+D[p]].push(p);
				}
			}
			for(int i=0;i<=L;i++)
			{
				if(q[nf][i].size()>1)
				{
					while(!q[nf][i].empty())
					{
						int p=q[nf][i].front();q[nf][i].pop();
						D[p]*=-1;
						w.push(p);
					}
					while(!w.empty())
					{
						q[nf][i].push(w.front());
						w.pop();
					}
				}
			}
		}
		printf("%d %d\n",r,ra);
	}
}