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.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class Main {

    public static void main(String[] args) 
    {

        
        Scanner scan = new Scanner(System.in);
        //String str = scan.nextLine();
        HashMap<String,Integer> map = new HashMap<String,Integer>();
        
        String text    = scan.nextLine();
              //  "This is the12-12-2013 text which is to be searched " +
                //"for occurrences of the word 'is'.";

        String patternString = "[0-9]{2}[-]{1}[0-9]{2}[-]201[3-5]{1}";

        Pattern pattern = Pattern.compile(patternString);
        Matcher matcher = pattern.matcher(text);

        int count = 0;
//      while(matcher.find()) {
//          count++;
//          System.out.println("found: " + count + " : "
//                  + matcher.start() + " - " + matcher.end());
//          if(matcher.start()>1)
//          {
//               matcher.find(2);
//               System.out.println("found: " + count + " : "
//                          + matcher.start() + " - " + matcher.end());
//          }
            
//      }
                
        int l = text.length();
         for(int i = 0;i<l;i++)
         {
             if(matcher.find(i))
             {
//               System.out.println("found: " + count + " : "
//                          + matcher.start() + " - " + matcher.end());
                 i = matcher.end()-3;
                 String st = matcher.group();
                 
                 int m = Integer.valueOf(st.substring(3,5));
                 if(m>0&&m<13)
                 {
                     int d = Integer.valueOf(st.substring(0,2));
                     if(d<=getD(m)&&d>0)
                     {
                         if(map.containsKey(matcher.group()))
                         {
                             int as = map.get(matcher.group());
                             map.put(matcher.group(), as+1);
                         }
                         else
                         {
                             map.put(matcher.group(), 1);
                         }
                     }
                 }
             }
         }
         Iterator it = map.entrySet().iterator();
         int max = 0;
         String maxstr = "";
         while(it.hasNext())
         {
             Map.Entry en = (Map.Entry)it.next();
             if((Integer)en.getValue()>max)
             {
                 max = (Integer)en.getValue();
                 maxstr = (String)en.getKey();
                 
             }
         }
         System.out.print(maxstr);
//      int yl = 10;
//      int yyl = 4;
//      for(int i = l-1;i>=yl;i++)
//      {
//          String sub  = str.substring(i-yyl, i);
//          if(sub.equals("2013")||sub.equals("2014")||sub.equals("2015"))
//          {
//              if(str.charAt(i-yyl-1)=='-');
//              {
//                  String sub2 = str.substring(i-yyl - 3,i-yyl);
//                  if(sub2.indexOf("-")==-1&&Integer.valueOf(sub2)>=1&&Integer.valueOf(sub2)<=12)
//                  {
//                      if(str.charAt(i-yyl-1)=='-');
//                      {
//                          String sub3 = str.substring(i-yyl-3-3,i-yyl-3);
//                      }
//                  }
//              }
//          }
//      }
//      System.out.print(-1);
//       
    }
    private  static int getD(int m)
    {
        switch(m)
        {
            case 1:
                return 31;
            case 2:
                return 28;
            case 3:
                return 31;
            case 4:
                return 30;
            case 5:
                return 31;
            case 6:
                return 30;
            case 7:
                return 31;
            case 8:
                return 31;
            case 9:
                return 30;
            case 10:
                return 31;
            case 11: 
                return 30;
            case 12:
                return 31;

                
        }
        return 0;
    }
 }







        
        
        
    
    
 
    

