Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <bits/stdc++.h>
using namespace std;

int main(){
  string str;
  cin>>str;
  int mxcnt=0;
  char ans;
  
  int i=0;
  while(i<str.size()){
    int cnt=0;
    char mae = 0;
    while(i<str.size()&&str[i]!=mae) {
      cnt++;
      mae=str[i];
      if(str[i]=='e') i+=3;
      else i+=7;
    }
    if(mxcnt<cnt) ans=mae,mxcnt=cnt;
  }

  if(ans=='e') cout <<"egg"<<endl;
  else cout << "chicken"<<endl;

}