#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;


signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, l;
    while(1){
        cin >> n >> l;
        if(n == 0 && l == 0) break;
        vector<int> d(n), a(n);
        vector<vector<int> > now(l + 1, vector<int>());
        vector<vector<int> > next(l + 1, vector<int>());
        int t = 0, idx = 0;
        rep(i, 0, n){
            char c;
            cin >> c >> a[i];
            now[a[i]].push_back(i);
            if(c == 'R'){
                d[i] = 1;
                chmax(t, l - a[i]);
            }else{
                d[i] = 0;
                chmax(t, a[i]);
            }
        }
        rep(i, 0, t){
            rep(j, 0, l + 1) next[j].clear();
            repb(j, l - 1, 1){
                if(now[j].size() == 2){
                    swap(d[now[j][0]], d[now[j][1]]);
                    swap(a[now[j][0]], a[now[j][1]]);
                }
                rep(k, 0, now[j].size()){
                    if(d[now[j][k]] == 1){
                        next[j + 1].push_back(now[j][k]);
                        if(j + 1 == l) idx = now[j][k];
                    }else{
                        next[j - 1].push_back(now[j][k]);
                        if(j - 1 == 0) idx = now[j][k];
                    }
                }
            }
            swap(now, next);
        }
        cout << t << ' ' << idx + 1 << endl;
    }
}
