Time Limit: 8 sec / Memory Limit: 64 MB





Example

Input

eggchickenegg


Output

egg
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

enum Type{
	None,
	Egg,
	Chiken,
};

int main(){

	Type pre = None,ans;

	int depth = 0,max_depth = 0;

	char buf[10001];
	scanf("%s",buf);

	for(int i = 0; buf[i] != '\0';){
		if(buf[i] == 'e'){
			if(pre == Egg){ //???????????????
				depth = 0;
				pre = None;
			}else{
				depth++;
				if(depth > max_depth){
					max_depth = depth;
					ans = Egg;
				}
				pre = Egg;
				i += 3;
			}
		}else{
			if(pre == Chiken){ //???????????????
				depth = 0;
				pre = None;
			}else{
				depth++;
				if(depth > max_depth){
					max_depth = depth;
					ans = Chiken;
				}
				pre = Chiken;
				i += 7;
			}
		}
	}

	if(ans == Egg){
		printf("egg\n");
	}else{
		printf("chicken\n");
	}


	return 0;
}