#include #include #include using namespace std; bool A_Z(char a){ return a>='A'&&a<='Z'; } bool a_z(char a){ return a>='a'&&a<='z'; } bool num(char a){ return a>='0'&&a<='9'; } bool kigo(char a){ return (!A_Z(a))&&(!a_z(a))&&(!num(a)); } char change(char a){ if(A_Z(a)){ return a-('A'-'a'); } return a; } int main(){ string in1,in2; while(cin>>in1){ in2==""; char in3=getchar(); while(in3!='\n'){ in2+=in3; in3=getchar(); } int s=in2.size(); bool f=false; if(in1=="digi"){ if(s>=3&&change(in2[s-1])=='o'&&change(in2[s-2])=='y'&&change(in2[s-3])=='n') f=true; if(s>=4&&kigo(change(in2[s-1]))&&change(in2[s-2])=='o'&&change(in2[s-3])=='y'&&change(in2[s-4])=='n') f=true; if(s>=5&&kigo(change(in2[s-1]))&&kigo(change(in2[s-2]))&&change(in2[s-3])=='o'&&change(in2[s-4])=='y'&&change(in2[s-5])=='n') f=true; if(s>=6&&kigo(change(in2[s-1]))&&kigo(change(in2[s-2]))&&kigo(change(in2[s-3]))&&change(in2[s-4])=='o'&&change(in2[s-5])=='y'&&change(in2[s-6])=='n') f=true; } else if(in1=="petit"){ if(s>=3&&change(in2[s-1])=='u'&&change(in2[s-2])=='y'&&change(in2[s-3])=='n') f=true; if(s>=4&&kigo(change(in2[s-1]))&&change(in2[s-2])=='u'&&change(in2[s-3])=='y'&&change(in2[s-4])=='n') f=true; if(s>=5&&kigo(change(in2[s-1]))&&kigo(change(in2[s-2]))&&change(in2[s-3])=='u'&&change(in2[s-4])=='y'&&change(in2[s-5])=='n') f=true; if(s>=6&&kigo(change(in2[s-1]))&&kigo(change(in2[s-2]))&&kigo(change(in2[s-3]))&&change(in2[s-4])=='u'&&change(in2[s-5])=='y'&&change(in2[s-6])=='n') f=true; } else if(in1=="gema"){ if(s>=4&&change(in2[s-1])=='a'&&change(in2[s-2])=='m'&&change(in2[s-3])=='e'&&change(in2[s-4])=='g') f=true; if(s>=5&&kigo(change(in2[s-1]))&&change(in2[s-2])=='a'&&change(in2[s-3])=='m'&&change(in2[s-4])=='e'&&change(in2[s-5])=='g') f=true; if(s>=6&&kigo(change(in2[s-1]))&&kigo(change(in2[s-2]))&&change(in2[s-3])=='a'&&change(in2[s-4])=='m'&&change(in2[s-5])=='e'&&change(in2[s-6])=='g') f=true; if(s>=7&&kigo(change(in2[s-1]))&&kigo(change(in2[s-2]))&&kigo(change(in2[s-3]))&&change(in2[s-4])=='a'&&change(in2[s-5])=='m'&&change(in2[s-6])=='e'&&change(in2[s-7])=='g') f=true; } else if(in1=="petit"){ if(s>=3&&change(in2[s-1])=='o'&&change(in2[s-2])=='y'&&change(in2[s-3])=='p') f=true; if(s>=4&&kigo(change(in2[s-1]))&&change(in2[s-2])=='o'&&change(in2[s-3])=='y'&&change(in2[s-4])=='p') f=true; if(s>=5&&kigo(change(in2[s-1]))&&kigo(change(in2[s-2]))&&change(in2[s-3])=='o'&&change(in2[s-4])=='y'&&change(in2[s-5])=='p') f=true; if(s>=6&&kigo(change(in2[s-1]))&&kigo(change(in2[s-2]))&&kigo(change(in2[s-3]))&&change(in2[s-4])=='o'&&change(in2[s-5])=='y'&&change(in2[s-6])=='p') f=true; } else{ for(int i=0;i