from collections import defaultdict

def main():
    s = raw_input()
    d = defaultdict(int)

    c3 = s.count('-2013')
    aryTargets = ['-2013','-2014','-2015']

    for k in aryTargets:
        pos_c =  5 #position to count starting
        c = s.count(k)
        for i in range(c):
            pos = s[pos_c:].index(k) + pos_c
            if (s[pos-5:pos-4]+s[pos-2:pos-1]).isalnum() and s[pos-3]=='-':
                d[s[pos-5:pos+5]] += 1
            pos_c = pos + 3
#    print(d)
    print(max(d.items(), key=lambda x: x[1])[0])

main()