import java.util.Scanner;
public class pets
{
public static void main (String[] args)
{
String readName1, readName2, readName3, readName4, readName5, n1, n2, n3, n4, n5;
int readAge1, readAge2, readAge3, readAge4, readAge5, a1, a2, a3, a4, a5, avgAge;
double readWeight1, readWeight2, readWeight3, readWeight4, readWeight5, w1, w2, w3, w4, w5, avgWeight;
Scanner a = new Scanner(System.in);
readName1 = a.nextLine();
readAge1 = a.nextInt();
readWeight1 = a.nextDouble();
Pet pet1 = new Pet(readName1, readAge1, readWeight1);
n1 = pet1.getName();
a1 = pet1.getAge();
w1 = pet1.getWeight();
Scanner b = new Scanner(System.in);
readName2 = b.nextLine();
readAge2 = b.nextInt();
readWeight2 = b.nextDouble();
Pet pet2 = new Pet(readName2, readAge2, readWeight2);
n2 = pet2.getName();
a2 = pet2.getAge();
w2 = pet2.getWeight();
Scanner c = new Scanner(System.in);
readName3 = c.nextLine();
readAge3 = c.nextInt();
readWeight3 = c.nextDouble();
Pet pet3 = new Pet(readName3, readAge3, readWeight3);
n3 = pet3.getName();
a3 = pet3.getAge();
w3 = pet3.getWeight();
Scanner d = new Scanner(System.in);
readName4 = d.nextLine();
readAge4 = d.nextInt();
readWeight4 = d.nextDouble();
Pet pet4 = new Pet(readName4, readAge4, readWeight4);
n4 = pet4.getName();
a4 = pet4.getAge();
w4 = pet4.getWeight();
Scanner e = new Scanner(System.in);
readName5 = e.nextLine();
readAge5 = e.nextInt();
readWeight5 = e.nextDouble();
Pet pet5 = new Pet(readName5, readAge5, readWeight5);
n5 = pet5.getName();
a5 = pet5.getAge();
w5 = pet5.getWeight();
avgWeight = (w1+w2+w3+w4+w5)/5;
avgAge = (a1+a2+a3+a4+a5)/5;
if ((a1 < a2) && (a1 < a3) && (a1 < a4) && (a1 < a5))
{
System.out.println(n1 + " is youngest.");
}
if ((a2 < a1) && (a2 < a3) && (a2 < a4) && (a2 < a5))
{
System.out.println(n2 + " is youngest.");
}
if ((a3 < a1) && (a3 < a2) && (a3 < a4) && (a3 < a5))
{
System.out.println(n3 + " is youngest.");
}
if ((a4 < a1) && (a4 < a2) && (a4 < a3) && (a4 < a5))
{
System.out.println(n4 + " is youngest.");
}
if ((a5 > a1) && (a5 > a2) && (a5 > a3) && (a5 > a4))
{
System.out.println(n5 + " is youngest.");
}
if ((a1 > a2) && (a1 > a3) && (a1 > a4) && (a1 > a5))
{
System.out.println(n1 + " is the oldest.");
}
if ((a2 > a1) && (a2 > a3) && (a2 > a4) && (a2 > a5))
{
System.out.println(n2 + " is the oldest.");
}
if ((a3 > a1) && (a3 > a2) && (a3 > a4) && (a3 > a5))
{
System.out.println(n3 + " is the oldest.");
}
if ((a4 > a1) && (a4 > a2) && (a4 > a3) && (a4 > a5))
{
System.out.println(n4 + " is the oldest.");
}
if ((a5 > a1) && (a5 > a2) && (a5 > a3) && (a5 > a4))
{
System.out.println(n5 + " is the oldest.");
}
}
}