#include <bits/stdc++.h>

using namespace std;

typedef long long llint;
typedef pair<int, int> P;

int main() {
  int n, l;
  while (true) {
    cin >> n >> l;
    if (l == 0) break;
    vector<int> d(n), p(n);
    for (int i = 0; i < n; i++) {
      char c;
      cin >> c >> p[i];
      if (c == 'R')
        d[i] = 1;
      else
        d[i] = -1;
    }
    int cnt = 0;
    vector<P> ans(n, P(0, 0));
    while (true) {
      cnt++;
      vector<int> dd(n), pp(n);
      for (int i = 0; i < n; i++) {
        if (p[i] == 0 || p[i] == l) continue;
        if (d[i] == 1) {
          pp[i] = p[i] + 1;
          dd[i] = d[i];
          for (int j = 0; j < n; j++) {
            if (i == j) continue;
            if (p[i] + 2 == p[j]) {
              if (d[j] == -1) {
                dd[i] = (-1) * d[i];
              }
            }
          }
        } else {
          pp[i] = p[i] - 1;
          dd[i] = d[i];
          for (int j = 0; j < n; j++) {
            if (i == j) continue;
            if (p[i] - 2 == p[j]) {
              if (d[j] == 1) {
                dd[i] = (-1) * d[i];
              }
            }
          }
        }
      }
      bool f = true;
      for (int i = 0; i < n; i++) {
        d[i] = dd[i];
        p[i] = pp[i];
        // cout << p[i] << " " << d[i] << endl;
        if (p[i] == 0 || p[i] == l) {
          if (ans[i].first == 0) {
            ans[i].first = cnt;
            ans[i].second = p[i];
          }
          continue;
        }
        f = false;
      }
      if (f) break;
    }
    int resid = 0, res = 0;
    for (int i = 0; i < n; i++) {
      if (res < ans[i].first) {
        res = ans[i].first;
        resid = i;
      } else if (res == ans[i].first) {
        if (ans[i].second == 0) {
          res = ans[i].first;
          resid = i;
        }
      }
    }
    cout << res << " " << resid + 1 << endl;
  }

  return 0;
}
