Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include<iostream>
#include<string>
#include<vector>

using namespace std;

int main(){

	string in="",zo="",tmp="";
	vector<string> vs;
	int ans=-1;

	cin>>in;

	for(int i=0;i<in.size();){
		if(in[i]=='e'){
			zo+='0';
			i+=3;
		}
		else{
			zo+='1';
			i+=7;
		}
	}
	
	tmp+=zo[0];
	for(int i=1;i<zo.size();i++){
		if(zo[i]!=zo[i-1]) tmp+=zo[i];
		else{
			vs.push_back(tmp);
			tmp="";
			tmp+=zo[i];
		}
	}

	if(!tmp.empty()) vs.push_back(tmp);

	ans=0;
	for(int i=1;i<vs.size();i++){
		if(vs[i].size()>vs[ans].size()){
			ans=i;
		}
	}

	if(vs[ans][vs[ans].size()-1]=='0') cout<<"egg"<<endl;
	else cout<<"chicken"<<endl;

	return 0;
}