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

public class AncientProphesy {

	public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(
				System.in));
		String s = input.readLine();
		String[] a = s.split("-");

		for (int i = 2; i < a.length-2; i++) {

			if (a[i].equals("") == false && a[i - 1].equals("") == false
					&& a[i - 2].equals("") == false
					&& a[i + 1].equals("") == false
					&& a[i + 2].equals("") == false) {

				// int bb = Integer.parseInt(a[i-2]);
				int b = Integer.parseInt(a[i - 1]);
				int bb = Integer.parseInt(a[i + 1]);
				// int bbbb = Integer.parseInt(a[i]);
				if (a[i].equals("2013") && a[i - 2].endsWith("13") && b <= 12
						&& b > 0 && bb <= 12 && bb > 0
						&& a[i + 2].equals("2013")) {
										
					System.out.println("13-" + b + "-2013");
					break;
				} else if (a[i].equals("2014") && a[i - 2].endsWith("14") && b <= 12
						&& b > 0 && bb <= 12 && bb > 0
						&& a[i + 2].equals("2014")) {
					
					System.out.println("14-" + b + "-2014");
					break;
				} else if (a[i].equals("2015") && a[i - 2].endsWith("15") && b <= 12
						&& b > 0 && bb <= 12 && bb > 0
						&& a[i + 2].equals("2015")) {
					
					System.out.println("15-" + b + "-2015");
					break;
					
				}

			}

		}
	}

}
