Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

int main()
{
	string str = "";
	cin >> str;
	while (str.find ("chicken" ) != string::npos ){
		str = str.replace (str.find ("chicken"), 1, "C" );
	} // end while
	while (str.find ("egg" ) != string::npos ){
		str = str.replace (str.find ("egg"), 1, "E" );
	} // end while

	string s = "";
	int n = str.length();
	rep (i, n ) if (str[i] == 'C' || str[i] == 'E' ) s += str[i];

	vector<string> ans; ans.clear();
	string curr = "";
	curr += s[0];
	for (int i = 1; i < s.length(); i++ ){
		if (curr[curr.length()-1] != s[i] ){
			curr += s[i];
		}else{
			ans.push_back (curr );
			curr = s[i];
		} // end if
	} // end for
	if (!curr.empty() ) ans.push_back (curr );

	int maxlen = 0;
	string res = "";
	rep (i, ans.size() ){
		if (maxlen < ans[i].size() ){
 			maxlen = ans[i].size();
			res = (ans[i][ans[i].size()-1] == 'C' ? "chicken" : "egg" );
		} // end if
	} // end rep
	cout << res << endl;

	return 0;
}