#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
// #include <bits/stdc++.h>

using namespace std;

#define LOG(...) fprintf(stderr, __VA_ARGS__)
//#define LOG(...)
#define FOR(i, a, b) for(int i=(int)(a); i<(int)(b); ++i)
#define REP(i, n) for(int i=0; i<(int)(n); ++i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SQ(n) (n) * (n)

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

struct ant {
  char d;
  int p;
};

int main() {
  int n, l;
  while(cin >> n >> l, n | l) {
    vector<ant> ants(n);
    REP(i, n){
      cin >> ants[i].d >> ants[i].p;
      ants[i].d = ants[i].d == 'L' ? -1 : 1;
    }

    int field[l + 1];
    for(int t = 1;; t++) {
      fill_n((int *)field, l + 1, -1);
      int last = -1;
      bool update = false;

      REP(i, n){
        if(ants[i].p <=0 || ants[i].p >= l) continue;
        ants[i].p += ants[i].d;
        if(ants[i].p <=0 || ants[i].p >= l) {
          // LOG("out : %d at %d --- %d\n", i + 1, t, ants[i].p);
          if(last == -1 || ants[last].p != 0) {
            last = i;
          }
          continue;
        }
        update = true;
        int p = ants[i].p;
        if (field[p] == -1) {
          field[p] = i;
        }else{
          ants[field[p]].d *= -1;
          ants[i].d *= -1;
        }
      }
      if(!update) {
        printf("%d %d\n", t, last + 1);
        break;
      }
    }
  }
}