import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int spy_num=5;
String spy_name;
ArrayList<Integer> FBI_list = new ArrayList<Integer>();
for(int i=0; i<spy_num;i++)
{
spy_name = reader.readLine();
if(spy_name.contains("FBI"))
FBI_list.add(i+1);
}
if(FBI_list.size()==0)
System.out.println("HE GOT AWAY!");
else {
for(int num:FBI_list)
System.out.print(num+" ");
}
}
}