import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
    
/**
 * @Author  Roman Dzhadan
 * @Team    VNTU [Noobs v3.0]
 * @E-Mail  dflash36@gmail.com
 * @Skype   ronex36
 */
public class Main {
        
    public static final String     TYPE              =   IOSystem.STANDART;
    public static final long       TIME_LIMIT        =   2;
    public static final long       MEMORY_LIMIT      =   512 * (1L << 20);
    public static final String     INPUT_FILE_NAME   =   "input.txt";
    public static final String     OUTPUT_FILE_NAME  =   "output.txt";
    public static final boolean    ONLINE_JUDGE      =   System.getProperty("ONLINE_JUDGE") != null;
        
    public static void main(String[] args) throws FileNotFoundException {
        Main task = new Main();
        IOSystem IO = (TYPE.equals(IOSystem.STANDART) ? task.new IOSystem() : task.new IOSystem(INPUT_FILE_NAME, OUTPUT_FILE_NAME));
        new Thread(null, task.new Task(IO), "", MEMORY_LIMIT).start();
    }

    
    class Task implements Runnable {
    //------------------------------------------------------  SOLUTION  -----------------------------------------------------------//   
            
        public void solveA() throws IOException {

            String a = in.readInt() + "";
            int b = in.readInt();
            int n = in.readInt();
            
            BigInteger B = new BigInteger("" + b);
            
            BigInteger counter = BigInteger.ONE;
            BigInteger one = BigInteger.ONE;
            
            while (true) {
                BigInteger res = B.multiply(counter);
                String s = res.toString();
                if (s.length() > n + a.length()) {
                    out.println(-1);
                    return;
                }
                if (s.length() == n + a.length() && s.startsWith(a)) {
                    out.println(s);
                    return;
                }
                counter = counter.add(one);
            }
        }
        
        public void solve() throws IOException {
            String line = in.readLine().replaceAll("-", "");
            int[]month = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
            for (int i = 2013; i <= 2015; i++) {
                for (int j = 1; j <= 12; j++) {
                    for (int k = 1; k <= month[j - 1]; k++) {
                        char[]pattern = new char[4];
                        Arrays.fill(pattern, '0');
                        if (k < 10) {
                            pattern[1] = (char)((k) + '0');
                        }
                        else {
                            pattern[0] = (char)((k / 10) + '0');
                            pattern[1] = (char)((k % 10) + '0');
                        }
                        if (j < 10) {
                            pattern[3] = (char)((j) + '0');
                        }
                        else {
                            pattern[2] = (char)((j / 10) + '0');
                            pattern[3] = (char)((j % 10) + '0');
                        }
                        String find = new String(pattern) + i;
                        String[]tmp = line.split(find);
                        int in = 0;
                        for (int l = 0; l < tmp.length; l++) {
                            if (!tmp.equals("")) {
                                in++;
                            }
                        }
                        if (tmp.length > 1 && in >= 1) {
                            out.println(find.substring(0, 2) + "-" + find.substring(2, 4) + "-" + find.substring(4));
                            return;
                        }
                    }
                }
            }
        }
        
    //-----------------------------------------------------------------------------------------------------------------------------//
        public void run() {
            try {
                long startTime = System.currentTimeMillis();
                solve();
                close();
                long endTime = System.currentTimeMillis();
                long totalMemory = Runtime.getRuntime().totalMemory();
                long freeMemory = Runtime.getRuntime().freeMemory();
                System.err.printf("Time = %.3f ms\n", (endTime - startTime) / 1000.0);
                System.err.printf("Memory = %.3f MB\n", (totalMemory - freeMemory) / (double)(1L << 20));
            }
            catch (Throwable e) {e.printStackTrace(System.err);System.exit(-1);}
        }
        public PrintWriter out;
        public IOSystem in;
        public Task(IOSystem io) {out = io.out; this.in = io;}
        public void close() throws IOException {in.in.close(); out.close();}
    }
    
    class IOSystem {
        public static final String FILE = "file";
        public static final String STANDART = "stdin";
        
        BufferedReader in;
        StringTokenizer tok;
        PrintWriter out;
        
        public IOSystem() {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            tok = new StringTokenizer("");
        }
        
        public IOSystem(String inputFileName, String outputFileName) throws FileNotFoundException {
            in = new BufferedReader(new FileReader(inputFileName));
            out = new PrintWriter(outputFileName);
            tok = new StringTokenizer("");
        }
        
        String readString() throws IOException {while (!tok.hasMoreTokens()) {String line = in.readLine();if (line == null) return null;tok = new StringTokenizer(line);}return tok.nextToken();}
        String readLine() throws IOException {return in.readLine();}
        int readInt() throws IOException {return Integer.parseInt(readString());}
        long readLong() throws IOException {return Long.parseLong(readString());}
        double readDouble() throws IOException {return Double.parseDouble(readString());}
        void debug(Object... o) {if (!Main.ONLINE_JUDGE) {System.err.println(Arrays.deepToString(o));}}
    }
}