import java.awt.*;
import java.io.*;
import hsa.*;
public class Problem
{

    public void read ()
    {
	String firstYear = "", secondYear = "", thirdYear = "", thirdMonth = "", secondMonth = "", firstMonth = "", firstDay = "", secondDay = "", thirdDay = "";
	int one = 0, two = 0, three = 0, one1 = 0, two2 = 0, three3 = 0, oneDay = 0, twoDay = 0, threeDay = 0;
	String message = "";
	String firstLine = "";
	String secondLine = "";
	String thirdLine = "";
	try
	{
	    BufferedReader input = new BufferedReader (new FileReader ("DATA1.txt"));
	    firstLine = input.readLine ();
	    secondLine = input.readLine ();
	    thirdLine = input.readLine ();
	    for (int x = firstLine.length () ; x < 6 ; x--)
	    {
		firstYear = firstYear + firstLine.charAt (x);
		one = Integer.parseInt (firstYear);

	    }
	    for (int x = secondLine.length () ; x < 6 ; x--)
	    {
		secondYear = secondYear + secondLine.charAt (x);
		two = Integer.parseInt (secondYear);

	    }
	    for (int x = thirdLine.length () ; x < 6 ; x--)
	    {
		thirdYear = thirdYear + thirdLine.charAt (x);
		three = Integer.parseInt (thirdYear);
	    }
	    for (int x = firstLine.charAt (3) ; x <= 4 ; x++)
	    {
		firstMonth = firstMonth + firstLine.charAt (x);
		one1 = Integer.parseInt (firstMonth);

	    }
	    for (int x = secondLine.charAt (3) ; x <= 4 ; x++)
	    {
		secondMonth = secondMonth + secondLine.charAt (x);
		two2 = Integer.parseInt (secondMonth);

	    }
	    for (int x = thirdLine.charAt (3) ; x <= 4 ; x++)
	    {
		thirdMonth = thirdMonth + thirdLine.charAt (x);
		three3 = Integer.parseInt (thirdMonth);
	    }
	    for (int x = firstLine.charAt (0) ; x <= 1 ; x++)
	    {
		firstDay = firstDay + firstLine.charAt (x);
		oneDay = Integer.parseInt (firstDay);

	    }
	    for (int x = secondLine.charAt (0) ; x <= 1 ; x++)
	    {
		secondDay = secondDay + secondLine.charAt (x);
		twoDay = Integer.parseInt (secondDay);

	    }
	    for (int x = thirdLine.charAt (0) ; x <= 1 ; x++)
	    {
		thirdDay = thirdDay + thirdLine.charAt (x);
		threeDay = Integer.parseInt (thirdDay);
	    }
	    PrintWriter output = new PrintWriter (new FileWriter ("OUT1.txt"));
	    if (one < 1998 && one1 <= 10 && oneDay <= 27)
		output.println ("old enough");
	    else
		output.println ("too young");
	    if (two < 1998 && two2 <= 10 && twoDay <= 27)
		output.println ("old enough");
	    else
		output.println ("too young");
	    if (three < 1998 && three3 <= 10 && threeDay <= 27)
		output.println ("old enough");
	    else
		output.println ("too young");
	    output.close ();
	}
	catch (IOException e)
	{
	    System.out.println ("Hi");
	}
    }


    public static void main (String[] args)
    {
	Problem p = new Problem ();
	p.read ();
    }
}

