Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    string s;
    cin >> s;
    int n = s.size();

    int i = 0;
    int len = 0;
    char ret;
    while(i < n){
        int tmp = 1;
        char prev = ' ';
        while(i < n && s[i] != prev){
            prev = s[i];
            if(s[i] == 'e')
                i += 3;
            else
                i += 7;
            ++ tmp;
        }

        if(tmp > len){
            len = tmp;
            ret = prev;
        }
    }

    if(ret == 'e')
        cout << "egg" << endl;
    else
        cout << "chicken" << endl;

    return 0;
}