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

using pii = pair<int,int>;
using ll = long long;
#define rep(i, j) for(int i=0; i < (int)(j); i++)
#define repeat(i, j, k) for(int i = (j); i < (int)(k); i++)
#define all(v) v.begin(),v.end()
#define debug(x) cerr << #x << " : " << x << endl

template<class T> bool set_min(T &a, const T &b) { return a > b  ? a = b, true : false; }
template<class T> bool set_max(T &a, const T &b) { return a < b  ? a = b, true : false; }
// vector
template<class T> istream&
operator >> (istream &is , vector<T> &v) { for(T &a : v) is >> a; return is; }
template<class T> ostream&
operator << (ostream &os , const vector<T> &v) { for(const T &t : v) os << "\t" << t; return os << endl; }
// pair
template<class T, class U> ostream&
operator << (ostream &os , const pair<T, U> &v) { return os << "<" << v.first << ", " << v.second << ">"; }

const int INF = 1 << 30;
const ll INFL = 1LL << 60;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(true) {
        int N, L; cin >> N >> L;
        if(N == 0) return 0;
        L *= 2;
        vector<int> D(N);
        vector<vector<int>> G[2];
        rep(i, 2) G[i].resize(L);
        rep(i, N) {
            char d;
            int p;
            cin >> d >> p;
            p *= 2;
            D[i] = d == 'L' ? -1 : 1;
            G[0][p].push_back(i);
        }
        int left = N;
        int time = 0;
        while(left > 0) {            
            int now = time % 2;
            int nxt = (now + 1) % 2;
            rep(i, L) G[nxt][i].clear();
            // go
            for(int i = L - 1; i > 0 ; i--) {
                while(G[now][i].size()) {
                    int idx = G[now][i].back(); G[now][i].pop_back();
                    int nxt_p = i + D[idx];
                    if(nxt_p == 0 or nxt_p ==L) {
                        left--;
                        if(left == 0) {
                            cout << time / 2 + 1 << " " << idx + 1 << endl;
                        }
                    } else {
                        G[nxt][nxt_p].push_back(idx);
                    }
                }
            }
            // check        
            for(int i = 0; i < L; i += 2) {
                assert(G[nxt][i].size() <= 2);
                if(G[nxt][i].size() == 2) {
                    swap(D[G[nxt][i][0]], D[G[nxt][i][1]]);
                }
            }
            time++;
        }    
    }
    return 0;
}