Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include<iostream>
using namespace std;

int main(){
  string s,ans;
  int num,cnt;
  char prv;

  cin >> s;
  cnt = 0; num = 0; prv = 'a';

  for(int i=0;i<(int)s.size();i++){
    if(prv != s[i]){
      cnt++; prv = s[i];
    }else{
      if(num < cnt){
	num = cnt;
	ans = (prv=='c')?"chicken":"egg";
      }
      cnt = 1;
    }
    if(s[i] == 'e')i += 2;
    else i += 6;
  }
  if(num < cnt)ans = (prv=='c')?"chicken":"egg";

  cout << ans << endl;
}