p=input()
data={}
for i in range(len(p)-9):
    if p[i+2] == p[i+5] and (p[i+6:i+10]).isdecimal():
        print(p[i:i+10])
        if p[i:i+10] in data:
            data[p[i:i+10]]+=1
        else:
            data[p[i:i+10]]=1


max_item=None
maximum=0

for i in data.keys():
    if data[i] > maximum:
        maximum = data[i]
        max_item=i


print(max_item)

