Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include<bits/stdc++.h>
using namespace std;
string s;
int d,maxd=-1,ans;

int main(){
  cin>>s;
  s+='#';
  for(int i=0;i<s.size();i++){
    if(s[i]=='e'){
      if(s[i+3]=='e'||s[i+3]=='#'){
	if(maxd<d)maxd=d,ans=0;
	d=0;
      }else d++;
      i+=2;
    }else{
      if(s[i+7]=='c'||s[i+7]=='#'){
	if(maxd<d)maxd=d,ans=1;
	d=0;
      }else d++;
      i+=6;
    }    
  }
  if(!ans)cout<<"egg"<<endl;
  else cout<<"chicken"<<endl;
  return 0;
}