Jenny has to prepare for several exams under the following rules:
Jenny wants to start her preparations as late as possible while still passing every exam. Find the latest day on which she can start.
The first line contains the number of exams $n$ ($1 \le n \le 50,000$). The exam descriptions follow.
Each description consists of three lines: the subject name (a string of Latin letters only, at most 10 characters), the exam date in dd.mm.yyyy format, and the value $t_i$ ($1 \le t_i \le 100,000$) for that exam.
All exams take place between 01.01.1900 and 31.12.2100.
A year is a leap year if it is divisible by 4 and not by 100, or if it is divisible by 400. A leap year has 366 days, with the extra day being February 29.
Print the latest date, in dd.mm.yyyy format, on which Jenny can start preparing and still pass all exams. If passing all exams is impossible, print Impossible.