Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
 
using namespace std;
 
#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
 
const int INF = 10000000;

int dx[]={-1,0,1,0};
int dy[]={0,-1,0,1};

//2362
int main(){
	string s;
	cin>>s;
	string ec[2] ={"egg", "chicken"};
	vii v;
	vi u;
	int last = -1;
	for(int i = 0; i < s.size(); i++){
		for(int j = 0; j < 2; j++){
			if(s[i] == ec[j][0]){
				if(j == last){
					v.pb(u);
					u.clear();
					u.pb(j);
				}
				else{
					u.pb(j);
					last = j;
				}
				i += ec[j].size() - 1;
			}
		}
	}
	v.pb(u);
	int m = 0;
	for(int i = 1; i < v.size(); i++){
		if(v[m].size() < v[i].size()) m = i;
	}

	cout<<ec[v[m][v[m].size() - 1]]<<endl;

}