Birthdates#4097

Birthdates

2 seconds
64 megabytes
Easy

Write a program to identify the youngest person and the oldest person in a class.

Input

The number (1 \le n \le 100) in the first line determines the number of people in a class. The following lines contain person's name and his/her birthdate.

The information in each line is of this format:

personName dd mm yyyy

where personName is a single word less than letters, dd mm yyyy are date, month and year of the birthdate.

Suppose that no one has the same name or the same birthdate.

Output

Print out lines containing the name of youngest person and oldest person, respectively.

Examples

Example 1

Loading
Loading