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
//    A Computer is Like a mischievous genie.
//    It will give you exactly what you ask for,
//    but not always what you want
//    A code by Rahul Verma


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
import java.util.SortedSet;

import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;



public class Main {



  public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

  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[] nextSArray() {
      String sr[] = null;
      try {
        sr = br.readLine().trim().split(" ");
      } catch (IOException e) {
        e.printStackTrace();
      }
      return sr;
    }

    String nextLine() {
      String str = null;
      try {
        str = br.readLine();
      } catch (IOException e) {
        e.printStackTrace();
      }

      return str;
    }
  }


//  static long powmodulo(long a, long p) {
//    if (p == 0)
//      return 1 % mod;
//    if (p == 1)
//      return a % mod;
//    long ans = 1;
//    while (p > 0) {
//      if ((p & 1) > 0) {
//        ans = (ans * a) % mod;
//      }
//      a = (a * a) % mod;
//      p = p >> 1;
//    }
//    return ans % mod;
//  }



//
//  static long mod = 1000000007;
//
//  static long gcd(long a,long b)
//  {
//    if(a==0)
//      return b;
//    return  gcd(b%a,a);
//  }
//
//  static long fast_powerNumbers(long a,long n)
//  {
//    if(n==1)
//      return a;
//    long ans=fast_powerNumbers(a,n/2);
//    if(n%2==0)
//      return (ans*ans);
//    else
//      return ((ans*ans)*(a));
//  }


//
//  static void dfs_helper(int [][] arr,int i,int j,int team,int n,int m)
//  {
//    arr[i][j]=team;
//    if(i-1>=0 && arr[i-1][j]==1)
//      dfs(arr,i-1,j,team,n,m);
//    if(j-1>=0 && arr[i][j-1]==1)
//      dfs(arr,i,j-1,team,n,m);
//    if(i+1< n && arr[i+1][j]==1)
//      dfs(arr,i+1,j,team,n,m);
//    if(j+1<m && arr[i][j+1]==1)
//      dfs(arr,i,j+1,team,n,m);
//
//  }
//
//
//  static int visited[];
//  static HashMap<Integer,ArrayList<Integer>>hm;
//
//
//  static void dfs(int [][] arr,int i,int j,int team,int n,int m)
//  {
//    dfs_helper(arr,i,j,team,n,m);
//
//  }

  static int day[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
  static boolean validDay(String s,int m)
  {
    if(Character.isDigit(s.charAt(0))&&Character.isDigit(s.charAt(1)))
    {
      int d=Integer.parseInt(s);
      if(d>0&&d<=day[m])
        return true;
    }
    return false;
  }

  static boolean validMonth(String s,String dd)
  {

    if(Character.isDigit(s.charAt(0))&&Character.isDigit(s.charAt(1)))
    {
      int m=Integer.parseInt(s);
      if(m>=1&&m<=12)
      {
        return validDay(dd,m);
      }

    }
    return false;
  }

  static boolean validYear(String s)
  {
   // System.out.println(s+" "+"y");
    if(Character.isDigit(s.charAt(0))&&Character.isDigit(s.charAt(1))&&Character.isDigit(s.charAt(2))&&Character.isDigit(s.charAt(3)))
    {
      int y=Integer.parseInt(s);
      if(y>=2013&&y<=2015)
      {
        return true;
      }

    }
    return false;

  }




  public static void main(String[] args) throws Exception {
    FastReader sc = new FastReader();

//    int t1 = sc.nextInt();
//
//    for (int t = 0; t < t1 ; t++) {
   String s=sc.nextLine();
   int n=s.length();

   HashMap<String ,Integer>hm=new HashMap<>();
    for (int i = 2; i < n-7; i++) {
     if(s.charAt(i)=='-')
     {
       String d=s.substring(i-2,i);
       String m=s.substring(i+1,i+3);
       String y=s.substring(i+4,i+8);
      // System.out.println(d+" "+m+" "+y+" "+validMonth(m,d)+" "+validYear(s));

       if(validMonth(m,d)&&validYear(y))
       {
         String date =d+'-'+m+'-'+y;
         if(hm.containsKey(date))
           hm.put(date,hm.get(date)+1);
         else
           hm.put(date,1);
       }
     }

    }
      String maxdate=" ";
   // System.out.println(hm);
    int max=0;
    for (String date: hm.keySet()
    ) {
      if(max<hm.get(date))
      {
        maxdate=date;
        max=hm.get(date);
      }
    }
    System.out.println(maxdate);
  }

}

class Pair
{
  int a; int b;
  Pair(int a,int b)
  {
    this.a=a;
    this.b=b;
  }
}


class Graph
{
  HashMap<Integer,ArrayList<Integer>>hm;
  Graph()
  {
    hm=new HashMap<>();
  }
  Graph(int n){

    hm=new HashMap<>();
    for (int i = 1; i <=n ; i++) {
      hm.put(i,new ArrayList<Integer>());
    }
  }
  // function for adding an edge.................................................
  public void addEdge(int a,int b,boolean isDir)
  {
    if(isDir)
    {
      if(hm.containsKey(a))
      {
        hm.get(a).add(b);
      }
      else
      {
        hm.put(a,new ArrayList<>(Arrays.asList(b)));
      }
    }
    else
    {
      if(hm.containsKey(a))
      {
        hm.get(a).add(b);
      }
      else if(!hm.containsKey(a))
      {
        hm.put(a,new ArrayList<>(Arrays.asList(b)));
      }

      if(hm.containsKey(b))
      {
        hm.get(b).add(a);
      }
      else if(!hm.containsKey(b))
      {
        hm.put(b,new ArrayList<>(Arrays.asList(a)));
      }
    }
  }

  public void addWeightededge(){

  }



}

// out.println(al.toString().replaceAll("[\\[|\\]|,]",""));
