Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <iostream>
#include <string>
using namespace std;

int main(){
	string s;
	int snum[1001];
	int count = 0;
	int ansnum=0;
	int anscount=-1;

	cin >> s;
	for(int i=0;i<s.size();){
		if(s[i] == 'e'){
			snum[count] = 1;
			count++;
			i += 3;
		}else{
			snum[count] = 2;
			count++;
			i += 7;
		}
	}

	int countbuf = 0;
	for(int i=0;i<count-1;i++){
		if(snum[i] != snum[i+1]){
			countbuf++;
		}else{
			if(anscount < countbuf){
				ansnum = snum[i];
				anscount = countbuf;
			}
			countbuf = 0;
		}
	}

	if(anscount < countbuf){
		ansnum = snum[count-1];
	}

	if(ansnum == 1){
		cout << "egg" << endl;
	}else{
		cout << "chicken" << endl;
	}
}