Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(10)
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

int main()
{
	string s;
	cin >> s;
	vector<vi> v;
	char nx = 'a';
	REP(i, s.size())
	{
		if (s[i] != nx)
		{
			vi t;
			t.push_back(s[i] == 'c' ? 1 : 0);
			v.push_back(t);
		}
		else
		{
			v.back().push_back(1 - v.back().back());
		}
		if (s[i] == 'c')
		{
			i += 6;
			nx = 'e';
		}
		else
		{
			i += 2;
			nx = 'c';
		}
	}
	int mx = 0;
	REP(i, v.size())
	{
		chmax(mx, (int)v[i].size());
	}
	REP(i, v.size())
	{
		if (v[i].size() == mx)
		{
			if (v[i].back() == 0) puts("egg");
			else puts("chicken");
			return 0;
		}
	}
	return 0;
}