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

int main() {
    string s;
    while (cin >> s) {
        vector<vector<int> > vv;
        vector<int> v;
        int st = -1;
        for (string::iterator it = s.begin(); it != s.end(); ) {
            if (*it == 'e') {
                if (st == 1) {
                    vv.push_back(v);
                    v.clear();
                }
                v.push_back(1);
                st = 1;
                it += 3;
            } else if (*it == 'c') {
                if (st == 2) {
                    vv.push_back(v);
                    v.clear();
                }
                v.push_back(2);
                st = 2;
                it += 7;
            }
        }
        vv.push_back(v);
        int max_vsize = vv[0].size(), idx = 0;
        for (int i = 1, size = vv.size(); i < size; i++) {
            int vsize = vv[i].size();
            if (max_vsize < vsize) {
                max_vsize = vsize;
                idx = i;
            }
        }
        if (vv[idx].back() == 1) {
            cout << "egg" << endl;
        } else {
            cout << "chicken" << endl;
        }
    }
}