The UPF schedule can be difficult to read, so Alice wants to write a program that tells her which classroom she has to go to at a given hour.
Input
The input consists of several test cases. Each test case starts with a number N describing the classes during a given week. The next N lines contain information about the classes: the name of the course, the day of the week, the time and the classroom. The following line contains a day of the week and a time.
Output
For each test case, output the classroom corresponding to the class of the given day and time.
Input
5 Algebra Monday 12:30 52.117 Programming Tuesday 10:30 52.023 Physics Wednesday 08:30 52.217 Calculus Thursday 10:30 52.019 Logic Thursday 12:30 52.123 Wednesday 08:30
Output
52.217