while 1:print min([`x`.translate("aaaabcde"*32)for x in range(5e4)],key=raw_input().find)