#include<bits/stdc++.h>
using namespace std;

#define int long long
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}

//0 1
//< >
//L R
const double EPS=1e-9;
int N,L;
int D[111],X[111];

void solve(){
    int ans=0;
    rep(i,N){
        char d;
        cin>>d>>X[i];
        if(d=='L')D[i]=0;
        else D[i]=1;
        chmax(ans,D[i]?L-X[i]:X[i]);
    }

    deque<int>d,id;
    deque<double>x;
    rep(i,N)d.pb(D[i]),id.pb(i),x.pb(X[i]);

    while(true){
        double hoge=111111111;
        rep(i,d.size()-1){
            if(d[i]==0||d[i+1]==1)continue;
            chmin(hoge,(x[i+1]-x[i])/2);
        }
        if(d[0]==0)chmin(hoge,x[0]);
        if(d.back()==1)chmin(hoge,L-x.back());
        rep(i,d.size()){
            if(d[i])x[i]+=hoge;
            else x[i]-=hoge;
        }
        rep(i,d.size()-1){
            if(d[i]==0||d[i+1]==1)continue;
            if(x[i+1]-x[i]<EPS){
                bool f=false;
                reps(j,1,L)if(abs(x[i]-j)<EPS)f=true;
                if(f){
                    d[i]=0;d[i+1]=1;
                }
                else{
                    swap(d[i],d[i+1]);
                    swap(id[i],id[i+1]);
                }
                i++;
            }
        }
        if(L-x.back()<EPS){
            if(d.size()==1){
                cout<<ans<<" "<<id[0]+1<<endl;
                return;
            }
            d.pop_back();id.pop_back();x.pop_back();
        }
        if(x.front()<EPS){
            if(d.size()==1){
                cout<<ans<<" "<<id[0]+1<<endl;
                return;
            }
            d.pop_front();id.pop_front();x.pop_front();
        }
        //rep(i,d.size())cout<<d[i]<<" ";cout<<"||";
        //rep(i,id.size())cout<<id[i]+1<<" ";cout<<endl;
    }
}

signed main(){
    while(cin>>N>>L,N||L)solve();
    return 0;
}