while line = gets.chomp do
  line.gsub!(/egg/,"eg")
  line.gsub!(/chicken/,"ch")
  nl = line.split(/hc|ge/)
  max = 0
  ans =""
  nl.each{|w|
    if max<w.size
      ans = w
      max = w.size
    end
  }
  if ans[ans.size-1]=="h"
    puts "chicken"
  else
    puts "egg"
  end
end