Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <iostream>
#include <cstdio>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());


int main(){
	string s;
	vector<string> v;
	cin>>s;
	while(s.size()){
		rep(i,s.size()){
			if(i+6<s.size()&&s.substr(i,6)=="eggegg"){
				v.PB(s.substr(0,i+3));
				s=s.substr(i+3);
				break;
			}
			else if(i+6<s.size()&&s.substr(i,6)=="kenchi"){
				v.PB(s.substr(0,i+3));
				s=s.substr(i+3);
				break;
			}
			else if(i==s.size()-1){
				v.PB(s);
				s="";
			}
		}
	}
	vector<pair<pii,string> > ans;
	rep(i,v.size()){
		int cnt=0;
		string t;
		while(v[i].size()){
			if(v[i].substr(0,3)=="egg"){
				t="egg";
				v[i]=v[i].substr(3);
				// cnt++;
			}
			else{
				t="chicken";
				v[i]=v[i].substr(7);
			}
			cnt++;
		}

		ans.PB(mkp(mkp(-cnt,i),t));
	}
	sort(ALL(ans));
	// rep(i,ans.size()){
		// cout<<ans[i].F.F<<" "<<ans[i].F.S<<" "<<ans[i].S<<endl;
	// }
	cout<<ans[0].S<<endl;
}