import sys
import time
import re
s=sys.stdin.readline()
a=re.findall('(?=(\d\d-\d\d-\d\d\d\d))',s)
dict = {}
for x in a:
    dict[x] = dict.get(x,0)+1
mx = max(dict.values())
for k in dict.keys():
    if dict[k] == mx:
        print k
        sys.exit()
