Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
	for(string s;getline(cin,s);){
		vector<vector<int> > a;
		for(int i=0;i<s.size();){
			int x;
			if(s[i]=='c')
				x=1,i+=7;
			else
				x=2,i+=3;
			if(a.size()==0 || x==a.back().back())
				a.push_back(vector<int>(1,x));
			else
				a.back().push_back(x);
		}
		int h=a.size(),w=0;
		for(int i=0;i<h;i++)
			w=max<int>(w,a[i].size());
		for(int i=0;i<h;i++)
			while(a[i].size()<w)
				a[i].push_back(-1);
		for(int i=0;i<h;i++)
			if(a[i][w-1]!=-1){
				cout<<(a[i][w-1]==1?"chicken":"egg")<<endl;
				break;
			}
	}
	
	return 0;
}