import re

s = str(raw_input())
date = re.compile("\\d{2}-\\d{2}-\\d{4}")

corrects = dict()

for c in date.findall(s):
  corrects[c] = corrects.get(c, 0) + 1

best = 0
answer = 0

for k in corrects:
  value = corrects[k]
  if value > best:
    answer = k
    best = value

print answer
