// implement 7min
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

int n, l;
pair<int, int> ants[100];


int main() {
  while (scanf("%d %d", &n, &l) > 0 && n) {
    REP(i, n) {
      char c;
      int p;
      scanf(" %c %d", &c, &p);
      int dir = c == 'L' ? -1 : 1;
      ants[i] = make_pair(dir, p);
    }
    int ans_sec = 0;
    int ans_ant = -1;
    int rest = n;
    while (rest > 0) {
      ans_sec++;
      map<int, int> hist;
      REP(i, n) {
        ants[i].second += ants[i].first;
        hist[ants[i].second]++;
      }
      REP(i, n) {
        if (hist[ants[i].second] >= 2) {
          ants[i].first *= -1;
        }
        if (ants[i].second == 0 || ants[i].second == l) {
          rest--;
          if (ans_ant == -1 || ants[ans_ant].second != 0) {
            ans_ant = i;
          }
        }
      }
    }
    printf("%d %d\n", ans_sec, ans_ant + 1);
  }
}