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;
import java.util.StringTokenizer;

public class Code implements Runnable {

    public static void main(String[] args) throws IOException {
        new Thread(new Code()).start();
    }

    private void solve() throws IOException {
        String date = nextToken();

        int len = 10;

        int[] months = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

        Map<String, Integer> dates = new HashMap<String, Integer>();
        for (int i = 0; i + len - 1 < date.length(); ++i) {
            String local = date.substring(i, i + len);

            if (local.charAt(2) == '-' && local.charAt(5) == '-'
                    && local.charAt(0) >= '0' && local.charAt(0) <= '9'
                    && local.charAt(1) >= '0' && local.charAt(1) <= '9'
                    && local.charAt(3) >= '0' && local.charAt(3) <= '9'
                    && local.charAt(4) >= '0' && local.charAt(4) <= '9'
                    && local.charAt(6) >= '0' && local.charAt(6) <= '9'
                    && local.charAt(7) >= '0' && local.charAt(7) <= '9'
                    && local.charAt(8) >= '0' && local.charAt(8) <= '9'
                    && local.charAt(9) >= '0' && local.charAt(9) <= '9') {
                int day = Integer.parseInt(local.substring(0, 2));
                int month = Integer.parseInt(local.substring(3, 5));
                int year = Integer.parseInt(local.substring(6, 10));

                if (month > 0 && month < 13 && day > 0 && day <= months[month] && year >= 2013 && year <= 2015) {
                    if (dates.containsKey(local))
                        dates.put(local, dates.get(local) + 1);
                    else
                        dates.put(local, 1);
                }
            }
        }

        int max = 0;
        String ans = "";
        for (Map.Entry<String, Integer> entry : dates.entrySet()) {
            if (entry.getValue() > max) {
                max = entry.getValue();
                ans = entry.getKey();
            }
        }

        writer.println(ans);
    }

    private class Pair<E, V> implements Comparable<Pair<E, V>> {
        public Pair(E first, V second) {
            this.first = first;
            this.second = second;
        }

        @Override
        public int compareTo(Pair<E, V> obj) {
            if (first.equals(obj.first)) return ((Comparable) second).compareTo(obj.second);
            return ((Comparable) first).compareTo(obj.first);
        }

        @Override
        public boolean equals(Object obj) {
            Pair other = (Pair) obj;
            return first.equals(other.first) && second.equals(other.second);
        }

        @Override
        public String toString() {
            return first + " " + second;
        }

        public E first;
        public V second;
    }

    @Override
    public void run() {
        try {
            if (in.equals(""))
                reader = new BufferedReader(new InputStreamReader(System.in));
            else
                reader = new BufferedReader(new FileReader(in));

            if (out.equals(""))
                writer = new PrintWriter(new OutputStreamWriter(System.out), false);
            else
                writer = new PrintWriter(new FileWriter(out), false);

            solve();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            //writer.println((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 + " KB");

            try {
                reader.close();
                writer.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    private float nextFloat() throws IOException {
        return Float.parseFloat(nextToken());
    }

    private String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(reader.readLine());

        return st.nextToken();
    }

    private String in = "", out = "";
    private BufferedReader reader;
    private PrintWriter writer;
    private StringTokenizer st;
}