Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <cstdio>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>

using namespace std;

const double EPS=(1e-10);
typedef long long ll;
typedef pair<int,int> pii;
bool EQ(double a,double b){
  return abs((a)-(b))<EPS;
}
void fast_stream(){
	std::ios_base::sync_with_stdio(0);
}

void solve(){
    const string e="egg";
    const string c="chicken";
    string s;
    cin>>s;
    vector<string> vs;
    for(int i=0;i<s.size();i++){
        if(s.substr(i,3)==e)vs.push_back(s.substr(i,3));
        else if(s.substr(i,c.size())==c)vs.push_back(s.substr(i,c.size()));
    }
    vector<vector<string> > vvs;
    vector<string> tmp;
    for(int i=0;i<vs.size();i++){
        if(tmp.size()==0||tmp[tmp.size()-1]!=vs[i])
            tmp.push_back(vs[i]);
        else{
            vvs.push_back(tmp);
            tmp.clear();
            tmp.push_back(vs[i]);
        }
    }
    if(tmp.size())vvs.push_back(tmp);
    int sz=0;
    int id=0;
    string res;
    for(int i=0;i<vvs.size();i++){
        if(sz<vvs[i].size()){
            res=vvs[i][vvs[i].size()-1];
            sz=vvs[i].size();
        }
    }
    cout<<res<<endl;
}
int main(){

    solve();

    return 0;
}