#include <stdio.h>
#include <iostream.h>
#include <string.h>
int fun(char a)
{
if(a=='a'||a=='A'||a=='e'||a=='i'||a=='o'||a=='u'||a=='E'||a=='I'||a=='O'||a=='U')
return 1;
else
return 0;
}
int main()
{
int n,i,j,k;
char s[4][100];
char ss[4][100];
int pos;
int black;
cin>>n;
for(i=0;i<n;i++)
{
for(j=0;j<4;j++)
gets(s[j]);
for(j=0;j<4;j++)
{
black=0;
pos=strlen(s[j])-1;
while(s[j][pos]==' ')
{
pos--;
black++;
}
while(s[j][pos]!=' ' && fun(s[j][pos])==0 && pos>0)
pos--;
if(s[j][pos]==' ')
pos++;
for(k=0;k<strlen(s[j])-pos-black;k++)
{
if(s[j][pos+k]<='Z' && s[j][pos+k]>='A')
ss[j][k]=s[j][pos+k]-'A'+'a';
else
ss[j][k]=s[j][pos+k];
}
ss[j][strlen(s[j])-pos-black]='\0';
}
if(strcmp(ss[0],ss[1])==0 && strcmp(ss[2],ss[3])==0)
{
if(strcmp(ss[0],ss[2])==0)
cout<<"perfect\n";
else
cout<<"even\n";
}
else if(strcmp(ss[0],ss[2])==0 && strcmp(ss[3],ss[1])==0)
{
cout<<"cross\n";
}
else if(strcmp(ss[0],ss[3])==0 && strcmp(ss[2],ss[1])==0)
{
cout<<"shell\n";
}
else
cout<<"free\n";
}
return 0;
}
评论