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.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.BitSet;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map.Entry;
public class A {
		public static class Pair {
			int no;
			String s;
			public Pair(int no,String s){
				this.no=no;
				this.s=s;
			}
		}
		
		public static void main(String[] args) throws IOException  {
			FastReader sc=new FastReader();
			String s=sc.next();
			Pair p[]=new Pair[s.length()]; 
			int c=0;
			String st="";
			int a[]=new int[13];
			int count=0;
			a[1]=31;a[2]=28;a[3]=31;a[4]=30;a[5]=31;a[6]=30;a[7]=31;a[8]=31;a[9]=30;a[10]=31;a[11]=30;a[12]=31;
			for(int i=s.length();i>=10;i--){
				if(s.substring(i-4, i).equals("2013") ||  s.substring(i-4, i).equals("2014") || s.substring(i-4, i).equals("2015")){
				//	System.out.println(s.charAt(i-5));
					if(s.charAt(i-5)=='-'){
					//	System.out.println(s.charAt(i-6));
						if(String.valueOf(s.charAt(i-6)).matches(".*[0-9].*")){
						//	System.out.println(s.charAt(i-6));
							String s1="";
							if(String.valueOf(s.charAt(i-7)).matches(".*[0-9].*")) s1+=String.valueOf(s.charAt(i-7));
							s1+=String.valueOf(s.charAt(i-6));
							if(Integer.parseInt(s1)>0 && Integer.parseInt(s1)<=12){
								if(s1.length()==2){
									if(s.charAt(i-8)=='-'){
									   if(String.valueOf(s.charAt(i-9)).matches(".*[0-9].*") && String.valueOf(s.charAt(i-10)).matches(".*[0-9].*")){
										   String s2=String.valueOf(s.charAt(i-10))+String.valueOf(s.charAt(i-9));
										   if(Integer.parseInt(s2)<=a[Integer.parseInt(s1)] && Integer.parseInt(s2)>0){
											   String finals=s2+"-"+s1+"-"+s.substring(i-4,i);
											 //  System.out.println(finals);
											   boolean isequal=false;
											   for(int j=0;j<c;j++){
												   if(p[j].no>=count){
													   count=p[j].no;
													   st=p[j].s;
												   }
												   if(p[j].s.equals(finals)){
													   p[j].no++;
													   isequal=true;
													   if(p[j].no>=count){
														   count=p[j].no;
														   st=p[j].s;
													   }
												   }
											   }
											   if(!isequal){
												   p[c++]=new Pair(1,finals);
												   if(p[c-1].no>=count){
													   count=p[c-1].no;
													   st=p[c-1].s;
												   }
											   }
										   }
									   }
									}
								}
								
							}
						}
					}
				}
				
			}
			System.out.println(st);
		}
		
       static class FastReader
		    {
		        BufferedReader br;
		        StringTokenizer st;
		 
		        public FastReader(){
		        		br = new BufferedReader(new InputStreamReader(System.in));
		        }
		 
		        String next()
		        {
		            while (st == null || !st.hasMoreElements())
		            {
		                try
		                {
		                    st = new StringTokenizer(br.readLine());
		                }
		                catch (IOException  e)
		                {
		                    e.printStackTrace();
		                }
		            }
		            return st.nextToken();
		        }
		 
		        int nextInt()
		        {
		            return Integer.parseInt(next());
		        }
		 
		        long nextLong()
		        {
		            return Long.parseLong(next());
		        }
		 
		        double nextDouble()
		        {
		            return Double.parseDouble(next());
		        }
		 
		        String nextLine()
		        {
		            String str = "";
		            try
		            {
		                str = br.readLine();
		            }
		            catch (IOException e)
		            {
		                e.printStackTrace();
		            }
		            return str;
		        }
		    }
}
