line = gets
line.chomp!
line.gsub!(/egg/,"e")
line.gsub!(/chicken/,"c")
nl = Array.new
p = 0
i=0
while i+1 < line.size do
  if line[i]==line[i+1]
    nl << line[p..i]
    p = i+1;
  end
  i+=1
end
nl << line[p...line.size]
max = 0
ans =String.new
nl.each{|w|
  if max<w.size
    max = w.size
    ans = w[max-1]=="e" ? "egg" : "chicken"
  end
}
puts ans