#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;

struct ant
{
    int pos;
    int dir;
    int num;
};

bool cmp(ant a,ant b)
{
    return a.pos<b.pos;
}

int main()
{
    int n,l;
    while (1)
    {
        scanf("%d%d",&n,&l);
        if (!n && !l) break;
        ant a[25];
        char str[2];
        int i,j;
        for (i=0;i<n;i++)
        {
            scanf("%s%d",str,&a[i].pos);
            a[i].num=i+1;
            if (str[0]=='R') a[i].dir=0;
            else a[i].dir=1;
        }
        sort(a,a+n,cmp);
        
        for (i=n-1;i>=0;i--)
        {
            if (a[i].dir==1) continue;
            for (j=i+1;j<n;j++)
            {
                if (a[j].dir==0) continue;
                int mod=(a[i].pos+a[j].pos)%2;
                if (!mod)
                {
                    int temp=a[i].num;
                    a[i].num=a[j].num;
                    a[j].num=temp;
                }
            }
        }
        int rightmax=0;
        int leftmax=0;
        int rightrec=0,leftrec=0;
        for (i=0;i<n;i++)
            if (a[i].dir==0)
            {
                rightmax=l-a[i].pos;
                rightrec=a[i].num;
                break;
            }
        for (i=n-1;i>=0;i--)
            if (a[i].dir==1)
            {
                leftmax=a[i].pos;
                leftrec=a[i].num;
                break;
            }
        if (rightmax>leftmax)
            printf("%d %d\n",rightmax,rightrec);
        else if (leftmax>rightmax)
            printf("%d %d\n",leftmax,leftrec);
        else
            printf("%d %d\n",leftmax,leftrec);
    }
}