Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <iostream>
#include <string>

using namespace std;

int main(){
  string in, tmp;
  cin >> in;
  char pre = ' ', ans;
  int valM = 0;
  for(int i=0;i<in.size();){
    char c = (in[i] == 'e' ? 'e' : 'c');
    if(pre == c){
      if(valM < tmp.size()){
        valM = tmp.size();
        ans = pre;
      }
      tmp = "";
    }
    tmp += c;
    i += (c == 'e' ? 3 : 7);
    pre = c;
  }
  if(valM < tmp.size()) ans = pre;
  cout << (ans == 'e' ? "egg" : "chicken") << endl;
}