/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
//package questionone;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

/**
 *
 * @author peterharquail
 */
public class QuestionOne {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws FileNotFoundException, IOException {
        FileReader infile = new FileReader("DATA1.txt");
        FileWriter outfile = new FileWriter("OUT1.txt");
        Scanner scan = new Scanner(infile);

        for (int i = 0; i < 5; i++) {
            int day;
            int month;
            int year;
            boolean end = false;

            day = scan.nextInt();
            month = scan.nextInt();
            year = scan.nextInt();

            if (year < 1997) {
                outfile.write("old enough\r\n");
                end = true;
            }
            if (month < 10 && end == false && year == 1997) {
                outfile.write("old enough\r\n");
                end = true;
            }
            if (day <= 27 && end == false && month == 10 && year == 1997) {
                outfile.write("old enough\r\n");
                end = true;
            }
            if(end == false){
            outfile.write("too young\r\n");
            }
        }
        outfile.close();
    }
}

