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>
struct date {
  int d;
  int m;
  int y;
};
int* maxdm(void) {
  int i = 0;
  int* mdm = (int*)malloc(13 * sizeof(int));
  for (i = 1; i < 13; i++) {
    mdm[i] = 30;
    if (i < 8) {
      if (i % 2 == 0) {
        if (i == 2) {
          mdm[i] = 28;
        } else {
          mdm[i] = 30;
        }
      } else {
        mdm[i] = 31;
      }
    } else {
      if (i % 2 == 0) {
        mdm[i] = 31;
      } else {
        mdm[i] = 30;
      }
    }
  }
  return mdm;
}
int isdigit(char c) {
  if (c < 58 && c > 47) {
    return 1;
  } else {
    return 0;
  }
}
int dateiscorrect(int d, int m, int y, int* mdm) {
  if (m < 0 || m > 12 || y > 2015 || y < 2013 || d < 1) {
    return 0;
  } else {
    if (mdm[m] >= d) {
      return 1;
    } else {
      return 0;
    }
  }
}
int main(void) {
  int* mdm = maxdm();
  char* s = (char*)malloc(100000);
  scanf("%s", s);
  int d, m, y;
  int i = 0;
  int nb = 0;
  int tab[12 * 31 * 3];
  for (i = 0; i < 12 * 31 * 3; i++) {
    tab[i] = 0;
  }
  i = 0;
  while (s[i + 9] != '\0') {
    if (isdigit(s[i + 0]) && isdigit(s[i + 1]) && isdigit(s[i + 3]) &&
        isdigit(s[i + 4]) && isdigit(s[i + 6]) && isdigit(s[i + 7]) &&
        isdigit(s[i + 8]) && isdigit(s[i + 9]) && s[i + 2] == '-' &&
        s[i + 5] == '-') {
      int d = (s[i + 0] - 48) * 10 + (s[i + 1] - 48);
      int m = (s[i + 3] - 48) * 10 + (s[i + 4] - 48);
      int y = (s[i + 6] - 48) * 1000 + (s[i + 7] - 48) * 100 +
              (s[i + 8] - 48) * 10 + (s[i + 9] - 48);
      if (dateiscorrect(d, m, y, mdm)) {
        tab[d - 1 + (m - 1) * 31 + (y - 2013) * 372]++;
        nb++;
      }
    }
    i++;
  }
  int pmax = 0;
  int max = 0;
  int tmp = 0;
  for (i = 0; i < 12 * 31 * 3; i++) {
    if (tab[i] > max) {
      max = tab[i];
      pmax = i;
    }
  }
  y = 2013 + pmax / 372;
  m = (pmax % 372) / 31 + 1;
  d = ((pmax % 372) % 31) + 1;
  if (d < 10) {
    printf("0");
  }
  printf("%d-", d);
  if (m < 10) {
    printf("0");
  }
  printf("%d-", m);
  printf("%d", y);
  return 0;
}
