#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr int MOD = 1e9 + 7;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, l;
    while (cin >> n >> l, n || l)
    {
        vector<int> d(n);
        vector<vector<int>> pos(l + 10);
        for (int i = 0; i < n; i++)
        {
            string s;
            cin >> s;
            if (s == "L")
                d[i] = 0;
            else
                d[i] = 1;
            int p;
            cin >> p;
            pos[p].push_back(i);
        }
        bool update = true;
        int res = 0, last;
        while (true)
        {
            update = false;
            int left = 0, right = 0;
            vector<vector<int>> tmp = pos;
            for (int i = 1; i <= l - 1; i++)
            {
                pos[i].clear();
            }
            for (int i = 1; i <= l - 1; i++)
            {
                for (int j = 0; j < (int)tmp[i].size(); j++)
                {
                    update = true;
                    int idx = tmp[i][j];
                    if (d[idx])
                    {
                        // R
                        pos[i + 1].push_back(idx);
                        if (i + 1 == l)
                            right = idx + 1;
                    }
                    else
                    {
                        pos[i - 1].push_back(idx);
                        if (i - 1 == 0)
                            left = idx + 1;
                    }
                }
            }
            if(left){
                last = left;
            }
            else if(right){
                last = right;
            }
            for (int i = 1; i <= l - 1; i++)
            {
                if (pos[i].size() < 2)
                    continue;
                int st = pos[i][0], gt = pos[i][1];
                d[st] = 1 - d[st];
                d[gt] = 1 - d[gt];
            }
            if (!update)
                break;
            res++;
        }
        cout << res << " " << last << endl;
    }
}

