#include <iostream>
#include <string>
using namespace std;

int main() {
    string in;
    cin>>in;
    int prev = -1, ans = -1,alen = -1,tlen = 0;
    for(int i=0; i<in.length(); ++i) {
        if(in[i] == 'e') {
            if(prev == 0) tlen = 1;
            else tlen++;

            if(tlen > alen) {
                ans = 0;
                alen = tlen;
            }
            prev = 0;
            i += 2;
        }else{
            if(prev == 1) tlen = 1;
            else tlen++;

            if(tlen > alen) {
                ans = 1;
                alen = tlen;
            }
            prev = 1;
            i += 6;
        }

    }

    if(ans) cout<<"chicken"<<endl;
    else cout<<"egg"<<endl;
}