Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include<iostream>
#include<string>
#include<vector>
using namespace std;
string S; vector<int>vec;
int main() {
	cin >> S;
	int maxn = 1, cnt = 1, p = 0, OK = 0;
	while (p < S.size()) {
		if (S[p] == 'e') {
			vec.push_back(0); p += 3;
		}
		if (S[p] == 'c') {
			vec.push_back(1); p += 7;
		}
	}
	for (int i = 1; i < vec.size(); i++) {
		if(vec[i - 1] != vec[i])cnt++;
		else {
			if (maxn < cnt) { maxn = cnt; OK = vec[i]; }
			cnt = 1;
		}
	}
	if (maxn < cnt) { maxn = cnt; OK = vec[vec.size() - 1]; }
	if (OK == 0)cout << "egg" << endl;
	if (OK == 1)cout << "chicken" << endl;
	return 0;
}