Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

int main() {
  string str;
  while (cin >> str) {
    char ans = '0';
    int pos = 0;
    int depth = 0;
    int maxDepth = -1;
    char prev = '0';
    while (pos < (int)str.size()) {
      int now = str[pos];
      if (now == 'c') {
        pos += 7;
      } else {
        assert(now == 'e');
        pos += 3;
      }
      if (prev == now) { depth = 0; }
      if (depth > maxDepth) {
        maxDepth = depth;
        ans = now;
      }
      prev = now;
      depth++;
    }
    puts(ans == 'c' ? "chicken" : "egg");
  }
}