//============================================================================
// Name : 620.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include <cstdio>
using namespace std;
string s;
int N;
int main() {
freopen("a.txt", "r", stdin);
while(scanf("%d", &N)!=EOF){
getchar();
while(N--){
getline(cin, s);
if(s.length() == 0) continue;
else if(s.length()%2 == 0){
printf("MUTANT\n");
}
else if(s.length() == 1){
if(s[0] == 'A') printf("SIMPLE\n");
else printf("MUTANT\n");
}
else{
if(s[s.length()-1] == 'B'&&s[s.length()-2] == 'A'){
printf("FULLY-GROWN\n");
}
else if(s[0] == 'B'&&s[s.length()-1] == 'A'){
printf("MUTAGENIC\n");
}
else printf("MUTANT\n");
}
}
}
return 0;
}