Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
/*
 * 2362.cc: Chicken or the Egg
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

typedef vector<int> vi;

/* global variables */

/* subroutines */

/* main */

int main() {
  string s;
  cin >> s;

  vi cs;
  for (int i = 0; i < s.size();) {
    if (s[i] == 'e') cs.push_back(0), i += 3;
    else cs.push_back(1), i += 7;
  }
  //for (int i = 0; i < cs.size(); i++) printf("%d", cs[i]); putchar('\n');

  int prv = -1, k = -1, maxk = -1, maxc = -1;

  for (int i = 0; i < cs.size(); i++) {
    if (prv == cs[i]) k = -1;
    k++;
    if (maxk < k) {
      maxk = k;
      maxc = cs[i];
    }
    prv = cs[i];
  }

  cout << (maxc == 0 ? "egg" : "chicken") << endl;
  return 0;
}