#include <iostream>
#include <cstdlib>
#include <set>
using namespace std;
int main ( ) {
int length, cnt, maxL, maxR, pos ,cntR, cntL, AI;
set<int> startPos;
char c;
while(cin >> length >> cnt) {
startPos.clear();
cntR = cntL = 0;
AI = 0;
maxL = length;
maxR = 0;
while(cnt--) {
cin >> pos;
c = cin.get();
c = cin.get();
if(c == 'R' && pos < maxL) {maxL = pos; cntR++;}
if(c == 'L' && pos > maxR) {maxR = pos; cntL++;}
startPos.insert(pos);
}
//int finalPos1;
int n = 0;
set<int>::iterator iter, iter2;
for ( iter = startPos . begin(); iter != startPos . end(); iter++, n++ )
{
if ( n == cntR ) break;
}
cout << "The last ant will fall down in ";
if(maxR >= length - maxL) cout << maxR;
else cout << (length - maxL);
cout << " seconds - started at ";
if(maxR == length - maxL && cntR > 0 && cntL > 0) {iter2 = ++iter; iter--; cout << *iter << " and " << *(iter2);}
else if(maxR >= length - maxL || cntR == 0 ) cout << *iter;
else if(maxR <= length - maxL || cntL == 0 ) {iter2 = ++iter; iter--; cout << *iter2;}
/*
if(maxR > length - maxL) cout << startPos[cntR-1];
if(maxR < length - maxL)cout << startPos[cntR];
if(maxR == length - maxL) cout << startPos[cntR-1] << " and " << startPos[cntR];
*/
cout << "." << endl;
//for(int i = 0; i < cntcp; i++) cout << "i" << startPos.[i] << endl;
}
return 0;
}
/*
90000 1
0 R
10 1
0 L
14 5
3 L
6 L
13 L
8 R
1 R
*/