fun main(args:Array<String>?): Unit {
    println(solve(readLine()!!.trim()))
}
fun solve(statement: String): String {
    tailrec fun takeWords(position: Int, last: String = "sentinel", length: Int = 0): Triple<String, Int, Int> {
        return when{
            statement.startsWith(last, position) -> Triple(last, position, length)
            statement.length == position -> Triple(last, position, length)
            statement.startsWith("egg", position) -> takeWords(position + 3, "egg", length + 1)
            else -> takeWords(position + 7, "chicken", length + 1)
        }
    }
    tailrec fun sub(position: Int, first: String = "", generation: Int = 0): String {
        return when(position) {
            statement.length -> first
            else -> {
                val (word, pos, gen) = takeWords(position)
                if (generation >= gen) sub(pos, first, generation)
                else sub(pos, word, gen)
            }
        }
    }
    return sub(0)
}
