#coding=utf-8
import sys,re,os,math,json
import datetime

if(__name__=='__main__'):
	istr=raw_input()
	res={}
	for i,ch in enumerate(istr):
		t=istr[i:i+10]
		try:
			m=re.match(r"(?P<dd>\d{2})-(?P<mm>\d{2})-(?P<yy>\d{4})",t)
			pat=m.groups()
			pat_dict=m.groupdict()
			cnt=res.get(pat,0)
			try:
				datetime.datetime(day=int(pat_dict['dd']),month=int(pat_dict['mm']),year=int(pat_dict['yy']))
				res[pat]=cnt+1
			except Exception,e:
				#print e
				pass
		except Exception,e:
			#print e
			pass
	print '-'.join(max(res.items(),key=lambda x:x[1])[0])
