Ancient Prophesy

题意翻译

## 题目描述 最近考古学家们发现了一个古老的预言,它包含了一个末日的日期**[真的]**。这个预言由一个字符串组成,且只包含数字和连字符**['-']**。考古学家们认为,末日的日期是一个形如**[dd-mm-yyyy]**的字串,可以有相交部分。一个日期出现的次数,就是这样的子串出现的次数。打个比方,对于预言**"0012-10-2012-10-2012"**,它就提到了两次2012年10月12日。【第一次是00**12-10-2012**-10-2012,第二次是0012-10-20**12-10-2012**(加粗字体)】。 世界末日的日期是合法的,并且是出现次数最多的那个日期。保证它出现的次数严格大于其他日期。 一个正确的日期,满足以下3个条件: 1.年份必定在2013至2015年间 2.月份在1~12月之间 3.日期不超过这个月的天数,且大于0 特别注意的是,日期是这样读出来的:**日-月-年**。这意味着它需要前导零。比如说,**1-1-2013**不满足格式【**dd-mm-yyyy**】,而**01-01-2013**则是一个合法的格式。 提醒一下,2013至2015年没有闰年。 ## 输入输出格式 ### 输入格式: 只有一行,是一个非空字符串,即上文提到的预言。保证由数字和连字符组成。长度不超过$10^5$。 ### 输出格式: 也只有一行,为世界末日的**日期**。格式为**[dd-mm-yyyy]** (不含括号)。

题目描述

A recently found Ancient Prophesy is believed to contain the exact Apocalypse date. The prophesy is a string that only consists of digits and characters "-". We'll say that some date is mentioned in the Prophesy if there is a substring in the Prophesy that is the date's record in the format "dd-mm-yyyy". We'll say that the number of the date's occurrences is the number of such substrings in the Prophesy. For example, the Prophesy "0012-10-2012-10-2012" mentions date 12-10-2012 twice (first time as "0012-10-2012-10-2012", second time as "0012-10-2012-10-2012"). The date of the Apocalypse is such correct date that the number of times it is mentioned in the Prophesy is strictly larger than that of any other correct date. A date is correct if the year lies in the range from $ 2013 $ to $ 2015 $ , the month is from $ 1 $ to $ 12 $ , and the number of the day is strictly more than a zero and doesn't exceed the number of days in the current month. Note that a date is written in the format "dd-mm-yyyy", that means that leading zeroes may be added to the numbers of the months or days if needed. In other words, date "1-1-2013" isn't recorded in the format "dd-mm-yyyy", and date "01-01-2013" is recorded in it. Notice, that any year between 2013 and 2015 is not a leap year.

输入输出格式

输入格式


The first line contains the Prophesy: a non-empty string that only consists of digits and characters "-". The length of the Prophesy doesn't exceed $ 10^{5} $ characters.

输出格式


In a single line print the date of the Apocalypse. It is guaranteed that such date exists and is unique.

输入输出样例

输入样例 #1

777-444---21-12-2013-12-2013-12-2013---444-777

输出样例 #1

13-12-2013