Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
	#include <iostream>
	using namespace std;

	char in[7010];
	int main(){
		char *p = in;
		int res,prev,r=0,max=0;
		cin >> in;
		while(*p){
			int t = (*p == 'c');
			if(prev == t) r=0;
			r++;
			prev = t;
			if(max < r){
				max = r;
				res = t;
			}
			p+=t?7:3;
		}
		cout << ((res) ? "chicken" : "egg") << endl;
	}