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.*;
import java.math.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.util.*;

public class Main
{    
   public static void main(String[] args) throws IOException
   {
      new Main().run();
   }

   StreamTokenizer in;
   PrintWriter out;
//deb////////////////////////////////////////////////
    public static void deb(String n ,Object n1){
     System.out.println(n+" is : "+n1);
 }  
    public static void deb(int[] A){
       
        for (Object oo : A) {
            System.out.print(oo+" ");
        }
        System.out.println("");
 }
     public static void deb(long[] A){
       
        for (Object oo : A) {
            System.out.print(oo+" ");
        }
        System.out.println("");
 }
      public static void deb(String[] A){
       
        for (Object oo : A) {
            System.out.print(oo+" ");
        }
        System.out.println("");
 }
      public static void deb(int[][] A){
          for (int i = 0; i < A.length; i++) {
               for (Object oo : A[i]) {
            System.out.print(oo+" ");
        }
        System.out.println("");
          }
       
 }
        public static void deb(long[][] A){
          for (int i = 0; i < A.length; i++) {
               for (Object oo : A[i]) {
            System.out.print(oo+" ");
        }
        System.out.println("");
          }
       
 }
          public static void deb(String[][] A){
          for (int i = 0; i < A.length; i++) {
               for (Object oo : A[i]) {
            System.out.print(oo+" ");
        }
        System.out.println("");
          }
       
 }
      /////////////////////////////////////////////////////////////
   int nextInt() throws IOException
   {
      in.nextToken();
      return (int)in.nval;
   }
   long nextLong() throws IOException
   {
      in.nextToken();
      return (long)in.nval;
   }
   
   void run() throws IOException
   {
    //  in = new StreamTokenizer(new BufferedReader(new FileReader("input.txt")));
     // out = new PrintWriter(new FileWriter("output.txt"));
     in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    out = new PrintWriter(new OutputStreamWriter(System.out));
      solve();
      out.flush();
   }

   void solve() throws IOException
   { 
    BufferedReader re= new BufferedReader(new InputStreamReader(System.in));
  String S=re.readLine();
  StringBuilder ss=new StringBuilder();
  ss.append(S.charAt(0));
       for (int i = 1; i < S.length(); i++) {
          if(S.charAt(i)=='-'&&S.charAt(i-1)=='-')
          ss.append(' ');
          
          ss.append(S.charAt(i));
          
       }
  S=ss.toString();
      // System.out.println(S);
  StringTokenizer st= new StringTokenizer(S, "-");
  String p1="",p2="",cc;
  int[][][] A= new int[3][13][32];
  int y=2013,d=1,m=1;
  int ct=0;
  while(st.hasMoreTokens()){
  
      cc=st.nextToken();
     
      
    //  System.out.println(cc);
       if(cc.length()>=4){
           
   y= Integer.parseInt(cc.substring(0,4));
  
       if(p1.length()==2){
            m=Integer.parseInt(p1);
            if(p2.length()>=2){
                d=Integer.parseInt(p2.substring(p2.length()-2,p2.length()));
       //        System.out.println(d+" "+y+" "+m);
                
       if(y==2013){
          // System.out.println(" wsq "+y);
        {
          if(m==1){if(d<=31)
           {
           A[0][m][d]++;
           }};
           if(m==2){if(d<=28)
           {
           A[0][m][d]++;
           }};
           if(m==3) {if(d<=31)
           {
           A[0][m][d]++;
           }};;
               if(m==4){if(d<=30)
           {
           A[0][m][d]++;
           }};;
               if(m==5){if(d<=31)
           {
           A[0][m][d]++;
           }};;
                       if(m==6){if(d<=30)
           {
           A[0][m][d]++;
           }};;
                          if(m==7){if(d<=31)
           {
           A[0][m][d]++;
           }};;
                               if(m==8){if(d<=31)
           {
           A[0][m][d]++;
           }};;
                                   if(m==9){if(d<=30)
           {
           A[0][m][d]++;
           }};;
                                       if(m==10){if(d<=31)
           {
           A[0][m][d]++;
           }};;
                                          if(m==11){if(d<=30)
           {
           A[0][m][d]++;
           }};;
                                               if(m==12){if(d<=31)
           {
           //    System.out.println("schslckn");
               A[0][m][d]++;
           }};;
          
               
       
       
       
       }
       
       };
           ;/////
      if(y==2014){
       {
      
        {
           if(m==1){if(d<=31)
           {
           A[1][m][d]++;
           }};;
           if(m==2){if(d<=28)
           {
           A[1][m][d]++;
           }};;
           if(m==3){if(d<=31)
           {
           A[1][m][d]++;
           }};;
               if(m==4){if(d<=30)
           {
           A[1][m][d]++;
           }};;
               if(m==5){if(d<=31)
           {
           A[1][m][d]++;
           }};;
                       if(m==6){if(d<=30)
           {
           A[1][m][d]++;
           }};;
                           if(m==7){if(d<=31)
           {
           A[1][m][d]++;
           }};;
                               if(m==8){if(d<=31)
           {
           A[1][m][d]++;
           }};;
                                   if(m==9){if(d<=30)
           {
           A[1][m][d]++;
           }};;
                                       if(m==10){if(d<=31)
           {
           A[1][m][d]++;
           }};;
                                          if(m==11){if(d<=30)
           {
           A[1][m][d]++;
           }};;
                                               if(m==12){if(d<=31)
           {
           A[1][m][d]++;
           }};;
          
               
       
       
       
       }
       
       }};
           ;/////
          
           if(y==2015){
       {
      {
           if(m==1){if(d<=31)
           {
           A[2][m][d]++;
           }};;
           if(m==2){if(d<=28)
           {
           A[2][m][d]++;
           }};;
          if(m==3){if(d<=31)
           {
           A[2][m][d]++;
           }};;
               if(m==4){if(d<=30)
           {
           A[2][m][d]++;
           }};;
              if(m==5){if(d<=31)
           {
           A[2][m][d]++;
           }};;
                       if(m==6){if(d<=30)
           {
           A[2][m][d]++;
           }};;
                           if(m==7){if(d<=31)
           {
           A[2][m][d]++;
           }};;
                               if(m==8){if(d<=31)
           {
           A[2][m][d]++;
           }};;
                                   if(m==9){if(d<=30)
           {
           A[2][m][d]++;
           }};;
                                       if(m==10){if(d<=31)
           {
           A[2][m][d]++;
           }};;
                                           if(m==11){if(d<=30)
           {
           A[2][m][d]++;
           }};;
                                               if(m==12){if(d<=31)
           {
           A[2][m][d]++;
           }};;
          
               
       
       
       
       }
       
       }};
           ;/////
           
       
       
       
       }};
       
       
   
   
   
   
   
   
   
   
   
   
   }
   
   
   
   
 p2=p1;
 p1=cc;
  
  }
  int max=0;
       for (int i = 0; i < 3; i++) {
           for (int j = 1; j < 13; j++) {
               for (int k = 1; k < 32; k++) {
                   if(A[i][j][k]>=max)
                   {y=i+2013; m=j;d=k;
                   max=A[i][j][k];
                      // System.out.println(" "+y+" "+m+" "+d);
                   }
               }
           }
       }
       String dd=""+d,mm=""+m,yy=""+y;
       while(dd.length()!=2)
           dd="0"+dd;
       while(mm.length()!=2)
           mm="0"+mm;
       
       System.out.println(dd+"-"+mm+"-"+yy);
   }
}