#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

int n,l;
char c[100];
int p[100];

bool input(){
    scanf("%d%d",&n,&l);
    REP(i,n){
        cin >> c[i] >> p[i];
        p[i] *= 2;
    }
    return n != 0;
}

void solve(){
    int t = 0;int down = 0;int e[1000],maxi;
    while(down < n){
        fill(e,e+1000,0);
        maxi = -1;
        REP(i,n){
            if(p[i] == -1)
                continue;
            if(c[i] == 'R')
                p[i]++;
            else
                p[i]--;
            if(p[i] == 0 || p[i] == l * 2){
                if(p[i] == 0 || (p[i] == l * 2 && maxi == -1))
                    maxi = i;
                p[i] = -1;
                down++;
                continue;
            }
            e[p[i]]++;
        }
        REP(i,l*2 + 2){
            if(e[i] == 2){
                vector<int> a;
                REP(j,n){
                    if(p[j] == i)
                        a.pb(j);
                }
                if(i % 2 == 0){
                    char ex = c[a[0]];
                    c[a[0]] = c[a[1]];
                    c[a[1]] = ex;
                }
            }
        }
        t++;
    }
    printf("%d %d\n",t/2,maxi+1);
}

int main(){
    while(input()){
        solve();
    }
}