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

import java.io.*;
import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: ekrylov
 * Date: 1/6/13
 * Time: 5:26 PM
 * To change this template use File | Settings | File Templates.
 */
public class B {

    private BufferedReader in;
    private PrintWriter out;
    private Map<String, Integer> map = new HashMap<String, Integer>();

    public static void main(String[] args) throws IOException {
        new B().solve();
    }

    public void solve() throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(new OutputStreamWriter(System.out));

        String s = in.readLine();
        for (int i = 0; i <= s.length() - 10; i++) {
            String sub = s.substring(i, i + 10);
            if (isDate(sub)) {
                if (!map.containsKey(sub)) {
                    map.put(sub, 0);
                }
                map.put(sub, map.get(sub) + 1);
            }
        }

        int max = Integer.MIN_VALUE;
        String res = null;
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            if (entry.getValue() > max) {
                max = entry.getValue();
                res = entry.getKey();
            }
        }

        out.print(res);
        out.flush();
    }

    private boolean isDate(String s) {
        if (s.charAt(2)!='-' || s.charAt(5)!='-') {
            return false;
        }

        String year = s.substring(6);
        if (!year.equals("2013") && !year.equals("2014") && !year.equals("2015")) {
            return false;
        }

        String mm = s.substring(3,5);
        if (!mm.equals("01") && !mm.equals("02") && !mm.equals("03") && !mm.equals("04") && !mm.equals("05") && !mm.equals("06") && !mm.equals("07") && !mm.equals("08") && !mm.equals("09") && !mm.equals("10") && !mm.equals("11") && !mm.equals("12")) {
            return false;
        }

        String dd = s.substring(0, 2);
        if (mm.equals("01") || mm.equals("03") || mm.equals("05") || mm.equals("07") || mm.equals("08") || mm.equals("10") || mm.equals("12")) {
            if (!dd.equals("01") && !dd.equals("02") && !dd.equals("03") && !dd.equals("04") && !dd.equals("05") && !dd.equals("06") && !dd.equals("07") && !dd.equals("08") && !dd.equals("09") && !dd.equals("10") && !dd.equals("11") && !dd.equals("12") && !dd.equals("13") && !dd.equals("14") && !dd.equals("15") && !dd.equals("16") && !dd.equals("17") && !dd.equals("18") && !dd.equals("19") && !dd.equals("20") && !dd.equals("21") && !dd.equals("22") && !dd.equals("23") && !dd.equals("24") && !dd.equals("25") && !dd.equals("26") && !dd.equals("27") && !dd.equals("28") && !dd.equals("29") && !dd.equals("30") && !dd.equals("31") ) {
                return false;
            }
        } else if (mm.equals("04") || mm.equals("06") || mm.equals("09") || mm.equals("11")) {
            if (!dd.equals("01") && !dd.equals("02") && !dd.equals("03") && !dd.equals("04") && !dd.equals("05") && !dd.equals("06") && !dd.equals("07") && !dd.equals("08") && !dd.equals("09") && !dd.equals("10") && !dd.equals("11") && !dd.equals("12") && !dd.equals("13") && !dd.equals("14") && !dd.equals("15") && !dd.equals("16") && !dd.equals("17") && !dd.equals("18") && !dd.equals("19") && !dd.equals("20") && !dd.equals("21") && !dd.equals("22") && !dd.equals("23") && !dd.equals("24") && !dd.equals("25") && !dd.equals("26") && !dd.equals("27") && !dd.equals("28") && !dd.equals("29") && !dd.equals("30")) {
                return false;
            }
        } else {
            if (!dd.equals("01") && !dd.equals("02") && !dd.equals("03") && !dd.equals("04") && !dd.equals("05") && !dd.equals("06") && !dd.equals("07") && !dd.equals("08") && !dd.equals("09") && !dd.equals("10") && !dd.equals("11") && !dd.equals("12") && !dd.equals("13") && !dd.equals("14") && !dd.equals("15") && !dd.equals("16") && !dd.equals("17") && !dd.equals("18") && !dd.equals("19") && !dd.equals("20") && !dd.equals("21") && !dd.equals("22") && !dd.equals("23") && !dd.equals("24") && !dd.equals("25") && !dd.equals("26") && !dd.equals("27") && !dd.equals("28")) {
                return false;
            }
        }
        return true;
    }

}
