import std.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;

const L = -1,
      R = 1;

class Ant {
    int index;
    int dir;
    int pos;
    bool left;
    this(int index, int dir, int pos) {
        this.index = index;
        this.dir = dir;
        this.pos = pos;
        this.left = false;
    }
}

void main() {
    int n, l;
    while (readf("%d %d\n", &n, &l), n || l) {
        Ant[] ants = new Ant[n];
        foreach (i; 1 .. n + 1) {
            char d; int p;
            auto input = readln.chomp.split(" ");
            d = input[0][0];
            p = input[1].to!int;
            ants[i - 1] = new Ant(i, (d == 'L' ? L : R), p);
        }

        Ant[] last = new Ant[2];
        void step() {
            foreach (ref ant; ants) {
                if (ant.left) continue;
                ant.pos += ant.dir;
            }
            foreach (i, ref ant; ants) {
                if (ant.left) continue;
                if (ant.pos >= l) {
                    ant.left = true;
                    last[1] = ant;
                }
                if (ant.pos <= 0) {
                    ant.left = true;
                    last[0] = ant;
                }
            }
            foreach (i; 0 .. ants.length) {
                if (ants[i].left) continue;
                foreach (j; i + 1 .. ants.length) {
                    if (ants[j].left) continue;
                    if (ants[i].pos == ants[j].pos) {
                        ants[i].dir *= -1;
                        ants[j].dir *= -1;
                    }
                }
            }
        }

        bool finished() {
            foreach (ant; ants) {
                if (!ant.left) return false;
            }
            return true;
        }

        int c = 0;
        while (!finished) {
            //writeln(c, " ", ants.map!((a) => (a.left ? [] : [a.index, a.pos, a.dir])).array);
            step();
            c++;
        }
        writeln(c, " ", (last[0] ? last[0] : last[1]).index);
    }
}