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.util.*;
import java.io.*;
import java.math.*;

public class Main {
	public static void main(String[] args) throws Exception {
		
		
		
		LR in = new LR();
		String s1 = in.nx();
		
		
		CS<ArrayList<Integer>> l1 = new CS();
		
		for (int i=0;i<s1.length()-9;i++){
			if (Character.isDigit(s1.charAt(i) ) )
				if (Character.isDigit(s1.charAt(i+1) ) )
					if (s1.charAt(i+2) == '-' )
						if (Character.isDigit(s1.charAt(i+3) ) )
							if (Character.isDigit(s1.charAt(i+4) ) )
								if (s1.charAt(i+5) == '-' )
									if (Character.isDigit(s1.charAt(i+6) ) )
										if (Character.isDigit(s1.charAt(i+7) ) )
											if (Character.isDigit(s1.charAt(i+8) ) )
												if (Character.isDigit(s1.charAt(i+9) ) ){
													int n1 = Integer.parseInt(s1.substring(i, i+2));
													int n2 = Integer.parseInt(s1.substring(i+3, i+5));
													int n3 = Integer.parseInt(s1.substring(i+6, i+10));
													ArrayList<Integer> temp = new ArrayList();
													temp.add(n1);
													temp.add(n2);
													temp.add(n3);
													//px(n1,n2,n3);
													
													if (valid(temp)){
														l1.add(temp);
													}
												}
		}
		//pn(l1);
		ArrayList<Integer> ans = null;
		int max = Integer.MIN_VALUE;
		for (ArrayList<Integer> e: l1.m1.keySet()){
			if (l1.get(e)>max){
				max = l1.get(e);
				ans = e;
			}
		}
		
		pn(String.format("%2s", ans.get(0)).replace(' ', '0')+"-"+String.format("%2s", ans.get(1)).replace(' ', '0')+"-"+ans.get(2));
	}
	public static int[] month = {100,31,28,31,30,31,30,31,31,30,31,30,31};
	public static boolean valid (ArrayList<Integer> l1){
		int n1 = l1.get(0);
		int n2 = l1.get(1);
		int n3 = l1.get(2);
		if (n1<1) return false;
		if (n2<1) return false;
		if (n3<1) return false;
		if (!(n3<=2015&&n3>=2013)) return false;
		if (!(n2<=12)) return false;
		if (!(n1<=month[n2])) return false;
		
		return true;
	}
	private static BigInteger bi(long n1) {
		return BigInteger.valueOf(n1);
	}

	private static void p(Object o1) {
		System.out.print(o1);
	}

	private static void pn(Object o1) {
		System.out.println(o1);
	}

	private static void px(Object... o1) {
		System.out.println(Arrays.deepToString(o1));
	}

	private static class LR {
		BufferedReader k1 = null;

		public LR() throws Exception {
			k1 = new BufferedReader(new InputStreamReader(System.in));
		}

		public String nx() throws Exception {
			return k1.readLine();
		}
	}

	private static class ST {
		StreamTokenizer k1 = null;

		public ST() throws Exception {
			k1 = new StreamTokenizer(System.in);
		}

		public int ni() throws Exception {
			k1.nextToken();
			return (int) k1.nval;
		}

		public double nd() throws Exception {
			k1.nextToken();
			return (double) k1.nval;
		}

		public long nl() throws Exception {
			k1.nextToken();
			return (long) k1.nval;
		}
	}
	
	
	
	public static class CS<E> {
		public long total = 0;
		public HashMap<E,Integer> m1 = new HashMap();
		public void add(E k1){
			add(k1,1);
		}
		public void remove(E k1){
			add(k1,-1);
		}
		public void add(E k1, int n1){
			int nv = 0;
			if (m1.containsKey(k1)){
				nv = m1.get(k1);
			}
			m1.put(k1, nv+n1);
			total+=n1;
			if (nv+n1==0){
				m1.remove(k1);
			}
		}
		public void set(E k1, int n1){
			int nv = 0;
			if (m1.containsKey(k1)){
				nv = m1.get(k1);
			}
			m1.put(k1, n1);
			total+=n1-nv;
			if (n1==0){
				m1.remove(k1);
			}
		}
		public int get(E k1){
			if (!m1.containsKey(k1)){
				return 0;
			}
			else {
				return m1.get(k1);
			}
		}
		public String toString(){
			return m1.toString();
		}
	}
}
