Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include<string>
#include<iostream>

using namespace std;

int main(){
	string s,t; cin>>s;
	for(int i=0;i<s.length();){
		t+=s[i];
		if(s[i]=='e') i+=3;
		else          i+=7;
	}

	string ans;
	for(int i=1,pre=0;i<=t.length();i++){
		if(i==t.length() || t[i-1]==t[i]){
			string tmp=t.substr(pre,i-pre);
			if(ans.length()<tmp.length()) ans=tmp;
			pre=i;
		}
	}

	cout<<(*ans.rbegin()=='e'?"egg":"chicken")<<endl;

	return 0;
}