#include <iostream> #include <string> using namespace std; //好好学英语 int main() { int NUM; cin>>NUM; string a[NUM][4]; string jg[NUM][4]; string c; getline(cin,c); for(int i=0;i<NUM;i++) { for(int j=0;j<4;j++) { getline(cin,a[i][j]); int hi=0; for(int k=a[i][j].size()-1;k>=0;k--) { if((a[i][j][k]>='A')&&(a[i][j][k]<='Z'))//变成小写字母 { a[i][j][k]=a[i][j][k]+32; } if((a[i][j][k]=='a') //||(a[i][j][k]=='A') ||(a[i][j][k]=='i') //||(a[i][j][k]=='I') ||(a[i][j][k]=='e') //||(a[i][j][k]=='E') ||(a[i][j][k]=='o') //||(a[i][j][k]=='O') ||(a[i][j][k]=='u')) //||(a[i][j][k]=='U'))//A、E、I、O、U { jg[i][j]=a[i][j].substr(k); hi=1; break; }else if((a[i][j][k]==' ')) { jg[i][j]=a[i][j].substr(k+1); hi=1; break; } } if(hi==0) { jg[i][j]=a[i][j]; } } } /* for(int i=0;i<NUM;i++) { for(int j=0;j<4;j++) { cout<<jg[i][j]<<endl; } }*/ for(int i=0;i<NUM;i++) { if((jg[i][0]==jg[i][1])&&(jg[i][0]==jg[i][2])&&(jg[i][0]==jg[i][3])) { cout<<"perfect"<<endl; }else if((jg[i][0]==jg[i][1])&&(jg[i][2]==jg[i][3])) { cout<<"even"<<endl; }else if((jg[i][0]==jg[i][2])&&(jg[i][1]==jg[i][3])) { cout<<"cross"<<endl; }else if((jg[i][0]==jg[i][3])&&(jg[i][1]==jg[i][2])) { cout<<"shell"<<endl; }else //if((jg[i][0]!=jg[i][1])&&(jg[i][0]!=jg[i][2])&&(jg[i][0]!=jg[i][3])) { cout<<"free"<<endl; } } return 0; } #include <iostream> #include <string> using namespace std; int main() { int T; cin>>T; string t; getline(cin,t); for(int o=0;o<T;o++) { string jg[4]=""; for(int i=0;i<4;i++) { string s; getline(cin,s); for(int j=0;j<s.size();j++) { if(s[j]>='A'&&s[j]<='Z') { s[j]=s[j]-'A'+'a'; } } int j; for(j=s.size()-1;j>=0;j--) { if(s[j]==' ') { break; } } jg[i]=s.substr(j+1,s.size()+1); //cout<<jg[i]<<endl; for(int j=jg[i].size()-1;j>=0;j--) { if(jg[i][j]=='a'||jg[i][j]=='e'||jg[i][j]=='i'||jg[i][j]=='o'||jg[i][j]=='u') { char c=jg[i][j]; //cout<<c<<endl; jg[i]=""; jg[i]=jg[i]+c; break; } } //cout<<jg[i]<<endl; } if(jg[0]==jg[1] && jg[1]==jg[2] && jg[2]==jg[3]) { cout<<"perfect"<<endl; continue; }else if(jg[0]==jg[1] && jg[2]==jg[3]) { cout<<"even"<<endl; continue; }else if(jg[0]==jg[2] && jg[1]==jg[3]) { cout<<"cross"<<endl; continue; }else if(jg[0]==jg[3] && jg[1]==jg[2]) { cout<<"shell"<<endl; continue; }else { cout<<"free"<<endl; continue; } } return 0; }