#include<bits/stdc++.h>
using namespace std;
//const long long mod=1000000007;
int main()
{
string s,id,t;
while(cin>>s)
{
int f1=0,f2=0;
for(int i=1;i<=4;i++)
{
cin>>id>>t;
if(id=="IMfather"&&t=="Callmefather")
{
f1=1;
}
if(id=="girl"&&t=="father")
{
f2=1;
}
}
if((f1==1&&f2==1)||(f2==0&&f1==1&&s=="RANK")) cout<<"father"<<endl;
else cout<<"hello"<<endl;
}
return 0;
}