import java.io.BufferedReader;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.StringTokenizer;
/**
*
* @author cteam022
*/
public class Ants {
/**
* @param args the command line arguments
*/
Ants g = new Ants();
while(true){g.uloha();}
}
if(!input.
ready()){System.
exit(0);} int L
= Integer.
valueOf(st.
nextToken()); int A
= Integer.
valueOf(st.
nextToken());
int[] pozic = new int[A];
boolean[] smery = new boolean[L+5];
int pravy = 0;
int levy = 0;
int cas2 = -1;
int mravenec2 = -1;
for(int i = 0; i<A; i++){
int pozice
= Integer.
valueOf(st.
nextToken()); boolean smer = (s.equals("R"));
pozic[i] = pozice;
//smery[i] = smer;
if(smer){
pravy++;
}else{
levy++;
}
if(pozice < cas1 && smer ) {
cas1 = pozice;
mravenec1 = i;
}
if(pozice > cas2 && smer==false ) {
cas2 = pozice;
mravenec2 = i;
}
}
cas1 = -1;
else
cas1 = L - cas1;
if(cas1 == cas2){
System.
out.
println("The last ant will fall down in " + cas1
+ " seconds - started at " + pozic
[levy
-1] + " and "+pozic
[levy
]); }else{
if(cas1 > cas2){
System.
out.
println("The last ant will fall down in " + cas1
+ " seconds - started at " +pozic
[levy
]); }else{
System.
out.
println("The last ant will fall down in " + cas1
+ " seconds - started at " +pozic
[levy
-1]); }
}
}
}