#include <iostream>
#include <algorithm>
#include <cassert>
#include <vector>
#include <cmath>
using namespace std;
#define LEFT true
#define RIGHT false
struct ant
{
ant(){};
ant(bool _dir, int _pos): dir(_dir),pos(_pos)
{ }
bool operator<(const ant& other) const
{
return pos < other.pos;
}
bool dir;
int pos;
};
int whois(int a, vector<ant> &ants, int length)
{
assert(a<ants.size());
bool dir = ants[a].dir;
int current = ants[a].pos;
int dist = dir==LEFT? current: length-current;
int lb = dir==LEFT? 0: a+1;
int rb = dir==LEFT? a-1: ants.size()-1;
while(lb<=rb && lb>=0 && rb<ants.size())
{
if(dir==LEFT)
{
bool found=false;
for(int i=lb; i<=rb; ++i)
{
if(ants[i].dir==RIGHT)
{
current=ants[i].pos;
lb = i+1;
dir = !dir;
found=true;
break;
}
}
if(!found) break;
}
else if(dir==RIGHT)
{
bool found=false;
for(int i=rb; i>=lb; --i)
{
if(ants[i].dir==LEFT)
{
current=ants[i].pos;
rb = i-1;
dir = !dir;
found=true;
break;
}
}
if(!found) break;
}
}
return current;
}
int main()
{
while(true)
{
int length, antCount;
cin >> length >> antCount;
if(!cin) break;
vector<ant> ants;
for(int i=0; i<antCount; ++i)
{
int pos;
string dir;
cin >> pos >> dir;
if(dir=="L")
{
ants.push_back(ant(LEFT, pos));
}
else if(dir=="R")
{
ants.push_back(ant(RIGHT, pos));
}
}
std::sort(ants.begin(), ants.end());
int ld=0;
int rd=0;
int ri=-1;
for(vector<ant>::iterator a=ants.begin(); a!=ants.end(); ++a)
{
if(a->dir==RIGHT)
{
ri=a-ants.begin();
rd = length-a->pos;
break;
}
}
int li=-1;
for(vector<ant>::iterator a=ants.end()-1; a!=ants.begin()-1; --a)
{
if(a->dir==LEFT)
{
li=a-ants.begin();
ld= a->pos;
break;
}
}
if(li==-1)
{
cout << "The last ant will fall down in "<<rd<<" seconds - started at "<<whois(ri,ants, length)<<"."<<endl;
} else if(ri==-1)
{
cout << "The last ant will fall down in "<<ld<<" seconds - started at "<<whois(li,ants,length)<<"."<<endl;
}
else if(ld<rd)
{
cout << "The last ant will fall down in "<<rd<<" seconds - started at "<<whois(ri,ants, length)<<"."<<endl;
}
else if(ld>rd)
{
cout << "The last ant will fall down in "<<ld<<" seconds - started at "<<whois(li,ants,length)<<"."<<endl;
}
else
{
int a = whois(li,ants,length);
int b = whois(ri,ants,length);
cout << "The last ant will fall down in "<<ld<<" seconds - started at "<<std::min(a,b)<<
" and "<<std::max(a,b)<<"."<<endl;
}
}
return 0;
}