Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <iostream>
#include <string>
using namespace std;
#define debug 0
int main(){
	string s;
	int count;
	int tmp;
	char c,ans;
	while(1){
		count=tmp=0;
		c=ans='?';
		cin>>s;
		
		if(s=="0")break;//debug
		
		for(int i=0;i<s.size();i+=3){
			if(s[i]!=c)count++;
			else count=1;
			c=s[i];
			if(count>tmp){
				tmp=count;
				ans=s[i];
			}
			if(s[i]=='c')i+=4;
		}
		if(ans=='e')cout<<"egg"<<endl;
		else cout<<"chicken"<<endl;
		
		if(debug==0)break;//debug
	}
	return 0; 
}
