
import java.util.*;
import java.io.*;

public class Problem1 {

    public static void main(String[] args) {


        try {

            Scanner input = new Scanner(new File("DATA1.txt"));

            FileWriter fw = new FileWriter("OUT1.txt");
            PrintWriter outfile;
            outfile = new PrintWriter(fw);

            int day1 = input.nextInt();
            int month1 = input.nextInt();
            int year1 = input.nextInt();
            boolean tooYoung = false;

            if (year1 > 1000) {
                if (year1 > 1997) {
                    outfile.println("too young");
                    tooYoung = true;
                } else if (year1 == 1997) {
                    if (month1 > 10) {
                        outfile.println("too young");
                        tooYoung = true;
                    } else if (month1 == 10) {
                        if (day1 > 27) {
                            outfile.println("too young");
                            tooYoung = true;
                        }
                    }
                }
            } else if (year1 < 1000) {
                if (year1 > 12 && year1 < 97) {
                    tooYoung = false;
                } else if (year1 == 97) {
                    if (month1 > 10) {
                        outfile.println("too young");
                        tooYoung = true;
                    } else if (month1 == 10) {
                        if (day1 > 27) {
                            outfile.println("too young");
                            tooYoung = true;
                        }
                    }
                } else if (year1 <= 12 && year1 >= 0) {
                    outfile.println("too young");
                    tooYoung = true;
                }
            }

            if (tooYoung == false) {
                outfile.println("old enough");
            }

            int day2 = input.nextInt();
            int month2 = input.nextInt();
            int year2 = input.nextInt();
            boolean tooYoung2 = false;

            if (year2 > 1000) {
                if (year2 > 1997) {
                    outfile.println("too young");
                    tooYoung2 = true;
                } else if (year2 == 1997) {
                    if (month2 > 10) {
                        outfile.println("too young");
                        tooYoung2 = true;
                    } else if (month2 == 10) {
                        if (day2 > 27) {
                            outfile.println("too young");
                            tooYoung2 = true;
                        }
                    }
                }
            } else if (year2 < 1000) {
                if (year2 > 12 && year2 < 97) {
                    tooYoung2 = false;
                } else if (year2 == 97) {
                    if (month2 > 10) {
                        outfile.println("too young");
                        tooYoung2 = true;
                    } else if (month2 == 10) {
                        if (day2 > 27) {
                            outfile.println("too young");
                            tooYoung2 = true;
                        }
                    }
                } else if (year2 <= 12 && year2 >= 0) {
                    outfile.println("too young");
                    tooYoung2 = true;
                }
            }

            if (tooYoung2 == false) {
                outfile.println("old enough");
            }
            
            int day3 = input.nextInt();
            int month3 = input.nextInt();
            int year3 = input.nextInt();
            boolean tooYoung3 = false;

            if (year3 > 1000) {
                if (year3 > 1997) {
                    outfile.println("too young");
                    tooYoung3 = true;
                } else if (year3 == 1997) {
                    if (month3 > 10) {
                        outfile.println("too young");
                        tooYoung3 = true;
                    } else if (month3 == 10) {
                        if (day3 > 27) {
                            outfile.println("too young");
                            tooYoung3 = true;
                        }
                    }
                }
            } else if (year3 < 1000) {
                if (year3 > 12 && year3 < 97) {
                    tooYoung3 = false;
                } else if (year3 == 97) {
                    if (month3 > 10) {
                        outfile.println("too young");
                        tooYoung3 = true;
                    } else if (month3 == 10) {
                        if (day3 > 27) {
                            outfile.println("too young");
                            tooYoung3 = true;
                        }
                    }
                } else if (year3 <= 12 && year3 >= 0) {
                    outfile.println("too young");
                    tooYoung3 = true;
                }
            }

            if (tooYoung3 == false) {
                outfile.println("old enough");
            }
            
            int day4 = input.nextInt();
            int month4 = input.nextInt();
            int year4 = input.nextInt();
            boolean tooYoung4 = false;

            if (year4 > 1000) {
                if (year4 > 1997) {
                    outfile.println("too young");
                    tooYoung4 = true;
                } else if (year4 == 1997) {
                    if (month4 > 10) {
                        outfile.println("too young");
                        tooYoung4 = true;
                    } else if (month4 == 10) {
                        if (day4 > 27) {
                            outfile.println("too young");
                            tooYoung4 = true;
                        }
                    }
                }
            } else if (year4 < 1000) {
                if (year4 > 12 && year4 < 97) {
                    tooYoung4 = false;
                } else if (year4 == 97) {
                    if (month4 > 10) {
                        outfile.println("too young");
                        tooYoung4 = true;
                    } else if (month4 == 10) {
                        if (day4 > 27) {
                            outfile.println("too young");
                            tooYoung4 = true;
                        }
                    }
                } else if (year4 <= 12 && year4 >= 0) {
                    outfile.println("too young");
                    tooYoung4 = true;
                }
            }

            if (tooYoung4 == false) {
                outfile.println("old enough");
            }
            
            int day5 = input.nextInt();
            int month5 = input.nextInt();
            int year5 = input.nextInt();
            boolean tooYoung5 = false;

            if (year5 > 1000) {
                if (year5 > 1997) {
                    outfile.println("too young");
                    tooYoung5 = true;
                } else if (year5 == 1997) {
                    if (month5 > 10) {
                        outfile.println("too young");
                        tooYoung5 = true;
                    } else if (month5 == 10) {
                        if (day5 > 27) {
                            outfile.println("too young");
                            tooYoung5 = true;
                        }
                    }
                }
            } else if (year5 < 1000) {
                if (year5 > 12 && year5 < 97) {
                    tooYoung5 = false;
                } else if (year5 == 97) {
                    if (month5 > 10) {
                        outfile.println("too young");
                        tooYoung5 = true;
                    } else if (month5 == 10) {
                        if (day5 > 27) {
                            outfile.println("too young");
                            tooYoung5 = true;
                        }
                    }
                } else if (year5 <= 12 && year5 >= 0) {
                    outfile.println("too young");
                    tooYoung5 = true;
                }
            }

            if (tooYoung5 == false) {
                outfile.println("old enough");
            }
            
            input.close();
            fw.close();
            outfile.close();

        } catch (Exception e) {
            System.out.println(e);
        }

    }
}
