Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
const int inf=1e8;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
int main(){
	char d,x;
	char out;
	char q=' ';
	int co=0;
	int ma=0;
	bool h=true;
	while(cin>>d){
		if(d=='c')rep(i,6)cin>>x;
		if(d=='e')rep(i,2)cin>>x;
		if(q!=d){
			if(h)out=d;
			co++;
		}else{
			if(ma<co){ma=co;co=1;out=d;}
			else co=1;
			h=false;
		}		
		q=d;
	}
	if(ma<co)out=d;
	if(out=='c')cout<<"chicken"<<endl;
	else cout<<"egg"<<endl;
}