Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

int main() {
  string s;
  cin >> s;
  vector<bool> v;
  for (int i=0; i<s.size();) {
    if (s[i] == 'e') {
      v.push_back(0);
      i += 3;
    } else {
      v.push_back(1);
      i += 7;
    }
  }
  int pre = -1;
  vector<bool> vv[1000];
  int num = 0;
  REP(i, v.size()) {
    if (i!=0 && v[i] == pre) {
      num++;
    }
    vv[num].push_back(v[i]);
    pre = v[i];
  }
  num++;
  int ma = -1;
  int id = 0;
  REP(i, num) {
    if ((int)vv[i].size() > ma ) {
      ma = vv[i].size();
      id = i;
    }
  }
  if (vv[id][vv[id].size()-1]) {
    cout << "chicken" << endl;
  } else {
    cout << "egg" << endl;
  }
}