from collections import Counter
f=raw_input();l=len(f)
year=['2010','2011','2012','2013','2015']
month=['01','02','03','04','05','06','07','08','09']
date=['01','02','03','04','05','06','07','08','09']
for i in range(10,100):date.append(str(i));month.append(str(i))
g=[]
for i in range(3,l-5):
    if f[i] == f[i+3] and f[i]=='-' and f[i+1:i+3] in month or f[i-2:i] in date and f[i+4:i+8] in year:g.append(f[i-2:i+8])
x=Counter(g).most_common()
if len(x)>0: print x[0][0]