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.math.BigInteger;

public class Watermelon {
	static int x;
	public static void main(String[] args)  {
	       Scanner sc=new Scanner(System.in);
	       String s=sc.next();
	       int n=s.length();
	      // String si="Hello";
	    //   System.out.println(si.substring(3, 5));
	       ArrayList<Count> list=new ArrayList<>();
	       for(int i=0;i<s.length();i++){
	    	   if(s.charAt(i)=='-'){
	    		   if(i-1>=0&&i-2>=0&&i+1<n&&i+2<n&&i+3<n&&i+4<n&&i+5<n&&i+6<n&&i+7<n)
	    		   if(s.charAt(i-1)!='-'&&s.charAt(i-2)!='-'&&s.charAt(i+1)!='-'&&s.charAt(i+2)!='-'&&s.charAt(i+4)!='-'&&s.charAt(i+5)!='-'&&s.charAt(i+6)!='-'&&s.charAt(i+7)!='-'&&s.charAt(i+3)=='-')
	    			  
	    			   list.add(new Count(1,s.substring(i-2, i+8)));
	    	   }
	       }
	    //   for(int i=0;i<list.size();i++){
	  //  	  list.get(i).display();
	//       }
//	       System.out.println();
           int count=0;
	       for(int i=0;i<list.size();i++){
	    	 int w=((list.get(i).s.charAt(6)-48)*1000)+((list.get(i).s.charAt(7)-48)*100)+((list.get(i).s.charAt(8)-48)*10)+((list.get(i).s.charAt(9)-48));
	    	 int x=((list.get(i).s.charAt(3)-48)*10)+((list.get(i).s.charAt(4)-48));
	    	 int y=((list.get(i).s.charAt(0)-48)*10)+((list.get(i).s.charAt(1)-48));
	    	//System.out.println(y+" "+x+" "+w);
	    	if(w<2013||w>2015)
	    		{list.remove(i);i--;continue;}
	    	 if(x<1||x>12)
	    	 {list.remove(i);i--;continue;}
	    	 if(x==1||x==3||x==5||x==7||x==8||x==10||x==12){
	    	    if(y<=0||y>31)
	    	    {list.remove(i);i--;continue;}
	    	  }
	    	  else if(x==4||x==6||x==9||x==11){
		    	    if(y<=0||y>30)
		    	    {list.remove(i);i--;continue;}
		    	  }
	    	  else if(x==2){
	    		  if(y<=0||y>28)
	    		  {list.remove(i);i--;continue;}
	    	  }
	    	  else{}
	    	  
	    	  
	       }
	//       for(int i=0;i<list.size();i++){
	//	    	  list.get(i).display();
	//	       }
		//       System.out.println();
	           
	       for(int i=0;i<list.size();i++){
	    	   for(int j=i+1;j<list.size();j++){
	    	   if(list.get(i).s.equalsIgnoreCase(list.get(j).s))
	    	      {
	    		  // System.out.println(list.get(i).s);
	    		   list.get(i).i++;list.remove(j);j--;
	    	      }
	    	   }
	       }
	  //     for(int i=0;i<list.size();i++){
	//	    	  list.get(i).display();
//		       }
	      // System.out.println();
	       Count[] carr=list.toArray(new Count[list.size()]);
	       Arrays.sort(carr);
	       //for(int i=0;i<carr.length;i++)
	    	   carr[carr.length-1].display();
	}
	
	private static int gcd(int a, int b)
	{
	    while (b > 0)
	    {
	    	int temp = b;
	        b = a % b; // % is remainder
	        a = temp;
	    }
	    return a;
	}
	private static int lcm(int a, int b)
	{
	    return a * (b / gcd(a, b));
	}
	static int[] toFractionPos(int x,int y){
		int a=gcd(x,y);
		int[] arr={x/a,y/a};
		//display(arr);
		return arr;
	}
    
	static void display(int[][] arr){
		for(int i=0;i<arr.length;i++){
			for(int j=0;j<arr[i].length;j++){
				System.out.print(arr[i][j]+" ");
			}
			System.out.println();
		}
		System.out.println();
	}
 
	 static void display(String[] arr){
			for(int i=0;i<arr.length;i++){
				
			}	
			System.out.println();
		
	 }
	 
		 static void display(int[] arr){
			 for(int i=0;i<arr.length;i++)
				 System.out.print(arr[i]+" ");
			 System.out.println();
		 }
	 static void display(double[] arr){
		// System.out.println();
			for(int i=0;i<arr.length;i++){
				System.out.println(arr[i]+" ");
			}	
//			System.out.println();
		
		  }
	 static String str(char[] carr){
		 String str="";
		 for(int i=0;i<carr.length;i++){
			    str=str+carr[i];
			}
		 return str;
	 }
	 
	}
class Count implements Comparable {
       String s;
       int i;
	Count(int i,String c){
			this.s=c;
			this.i=i;
		}	
		
		void display(){
			System.out.println(s);
		}
		@Override
		public int compareTo(Object o) {
		   Count co=(Count)o;
		   
		   if(co.i<this.i){
			   return 1;
		   }
		   else if(this.i<co.i){
			   return -1;
		   }
		   else
			   return 0;
		}
		
		
	}
