#include
using namespace std;
int main()
{
string zbor;
cin >> zbor;
for(int i = 0; i < zbor.size(); i++) {
if(isdigit(zbor[i])) {
cout << "CIFRA" << endl;
}
else if(isalpha(zbor[i])) {
if(isupper(zbor[i])) {
cout << "GOLEMA" << endl;
}
else {
cout << "MALA" << endl;
}
}
}
return 0;
}