//59
#include<iostream>

using namespace std;

int main(){
  char s[7*1001];
  cin>>s;
  char p=0;
  int l=0;
  char r;
  int rl=-1;
  for(int i=0;s[i];i+=(p=='e')?3:7){
    if(p==s[i]){
      l=0;
    }
    l++;
    p=s[i];
    if(l>rl){
      rl=l;
      r=p;
    }
  }
  cout<<((r=='e')?"egg":"chicken")<<endl;
  return 0;
}