s = gets.chomp
s.gsub!("egg", "0")
while s.gsub!("00", "0,0")
end
s.gsub!("chicken", "1")
while s.gsub!("11", "1,1")
end
s = s.split(",")
arr = []
s.each_with_index{|x, i| arr << [x, i]}
arr.sort_by!{|a, b| [-a.length, b]}
puts (arr[0][0][-1] == "0" ? "egg" : "chicken")

