Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include<iostream>
#include<sstream>
#include<vector>
#include<map>
#include<queue>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cassert>
using namespace std;

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define fr(i,c) for(__typeof(c.begin()) i=c.begin();i!=c.end();i++)
#define pb push_back
#define mp make_pair
#define all(c) c.begin(),c.end()

typedef vector<int> vi;
typedef pair<int,int> pi;
typedef long long ll;
const int inf=(int)1e9;
const double EPS=1e-9, INF=1e12;

string in;

int main(){
	cin>>in;
	vi v,tmp;
	rep(i,in.size()){
		if(in[i]=='e')v.pb(0), i+=2;
		else v.pb(1), i+=6;
	}
	vector<vi> vv;
	rep(i,v.size()){
		if(tmp.size()&&tmp.back()==v[i]){
			vv.pb(tmp);
			tmp.clear();
		}
		tmp.pb(v[i]);
	}
	vv.pb(tmp);
	int mx=0, mxi;
	rep(i,vv.size())if((int)vv[i].size()>mx)mx=vv[i].size(),mxi=i;
	if(!vv[mxi].back())cout<<"egg"<<endl;
	else cout<<"chicken"<<endl;
	
	return 0;
	
}