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.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.Stack;

import com.sun.corba.se.impl.oa.poa.ActiveObjectMap.Key;

public class Test {
	public static void redirectIn(String fileName){
		FileInputStream fileStream=null;
		try {
			fileStream=new FileInputStream(fileName);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		BufferedInputStream input=new BufferedInputStream(fileStream);
		System.setIn(input);
	}
	public static void redirectOut(String fileName){
		FileOutputStream fileStream=null;
		try {
			fileStream=new FileOutputStream(fileName);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		PrintStream output=new PrintStream(fileStream);
		System.setOut(output);
	}
	public static Scanner initCin(){
//		redirectIn("test.in");
		return new Scanner(new BufferedInputStream(System.in));
	}
	public static PrintStream initOut(){
//		redirectOut("output.txt");
		return System.out;
	}
	
	public final static PrintStream out=initOut();
	public final static Scanner cin=initCin();
	
	static HashMap<Integer, Integer> map=new HashMap<>();
	static int[] monthDays={0,31,28,31,30,31,30,31,31,30,31,30,31};
	static void parseDate(String date){
		if(date.charAt(2)!='-'||date.charAt(5)!='-') return;
		String days=date.substring(0,2),months=date.substring(3,5),years=date.substring(6,10);
		int d=0,m=0,y=0,hash=0;
		try {
			d=Integer.parseInt(days);
			m=Integer.parseInt(months);
			y=Integer.parseInt(years);
		} catch (Exception e) {
			return;
		}
		if(y<2013||y>2015) return;
		if(m<1||m>12) return;
		if(d<1||d>monthDays[m]) return;
		hash=(((d<<4)+m)<<11)+y;
		if(map.containsKey(hash)){
			map.put(hash, map.get(hash)+1);
		}else{
			map.put(hash, 1);
		}
	}
	public static void main(String[] args){
		String text=cin.next();
		for(int i=0;i<=text.length()-10;++i){
			parseDate(text.substring(i, i+10));
		}
		Entry<Integer, Integer> maxKey=null;
		for(Entry<Integer, Integer> key:map.entrySet()){
			if(maxKey==null) maxKey=key;
			else if(key.getValue()>maxKey.getValue()) maxKey=key;
		}
		int d=maxKey.getKey()>>15,m=(maxKey.getKey()>>11)&(15),y=maxKey.getKey()&2047;
		out.printf("%02d-%02d-%d", d,m,y);
		return;
	}
}
