Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <iostream>
#include <string>

using namespace std;
int main(){
	string s;
	cin >> s;

	int best = 0;
	char ans;
	int cnt = 0, idx = 0;
	char prev = 'x';
	while(idx < s.size()){
		if(idx &&  s[idx] != prev){
			cnt++;
		}else{
			if(best < cnt){
				ans = prev;
				best = cnt;
			}
			cnt = 0;
		}
		prev = s[idx];
		idx += (s[idx]=='e'?3:7);
	}
	if(best < cnt){
		ans = prev;
		best = cnt;
	}
	cout << (ans=='e'?"egg":"chicken") << endl;


	return 0;
}