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.

Input

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 105 characters.

Output

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

Examples

Input

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


Output

13-12-2013
#include <bits/stdc++.h>
using namespace std;
long long n, m, ans;
string str;
map<string, long long> m1;
long long solve() {
  cin >> str;
  n = (long long)str.size();
  for (long long i = 0; i <= n - 10; ++i) {
    string s = str.substr(i, 10);
    vector<long long> v1;
    for (long long j = 0; j <= 9; ++j) {
      if (s[j] == '-') v1.push_back(j);
    }
    if ((long long)v1.size() == 2 && v1[0] == 2 && v1[1] == 5) {
      long long f = 0;
      string s1 = s.substr(0, 2);
      string s2 = s.substr(3, 2);
      string s3 = s.substr(6, 4);
      long long a1 = stoll(s1), a2 = stoll(s2), a3 = stoll(s3);
      if (a3 >= 2013 && a3 <= 2015) {
        if (a2 == 1 && a1 >= 1 && a1 <= 31)
          f = 1;
        else if (a2 == 2 && a1 >= 1 && a1 <= 28)
          f = 1;
        else if (a2 == 3 && a1 >= 1 && a1 <= 31)
          f = 1;
        else if (a2 == 4 && a1 >= 1 && a1 <= 30)
          f = 1;
        else if (a2 == 5 && a1 >= 1 && a1 <= 31)
          f = 1;
        else if (a2 == 6 && a1 >= 1 && a1 <= 30)
          f = 1;
        else if (a2 == 7 && a1 >= 1 && a1 <= 31)
          f = 1;
        else if (a2 == 8 && a1 >= 1 && a1 <= 31)
          f = 1;
        else if (a2 == 9 && a1 >= 1 && a1 <= 30)
          f = 1;
        else if (a2 == 10 && a1 >= 1 && a1 <= 31)
          f = 1;
        else if (a2 == 11 && a1 >= 1 && a1 <= 30)
          f = 1;
        else if (a2 == 12 && a1 >= 1 && a1 <= 31)
          f = 1;
      }
      if (f) m1[s]++;
    }
  }
  for (auto it : m1) ans = max(ans, it.second);
  for (auto it : m1) {
    if (ans == it.second) {
      cout << it.first;
      return 0;
    }
  }
  return 0;
}
signed main() {
  ios::sync_with_stdio(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
