from datetime import date, timedelta

def count(haystack, needle):
    start   = 0
    matches = 0
    while True:
        start = haystack.find(needle, start)
        if start < 0:
            break
        start   += 1
        matches += 1
    return matches

if __name__ == "__main__":
    s = raw_input()
    b = date(2013, 01, 01)
    e = date(2015, 12, 31)
    mfreq = 0
    res = ""
    while b < e:
        datestr = b.strftime("%d-%m-%Y")
        cnt = count(s, datestr)
        if mfreq < cnt:
            mfreq = cnt
            res = datestr
        b += timedelta(days = 1)
    print res
