Олимпиадный тренинг

Задача 38992. New airport


A new airport began to operate at the airport in the city of Che.  On the first day of work, a file was recorded with the time of arrival and departure of aircraft. Aircraft that departed the next day were not recorded in the file. Determine the maximum number of planes that were at the airport at the same time and during what maximum period of time (in minutes) such a number of planes were at the airport. Only planes, information about which is recorded in the file, are taken into account.

Input
The first line contains the number N - the total number of planes for the whole day. Each of the following N lines contains a pair of values, where the first value in the pair indicates the time of arrival of the aircraft, and the second value indicates the time of departure (arrival and departure times are in the range from 00:00 to 23 :59, and it is guaranteed that the arrival time is less than the departure time) . All data in the lines is separated by a single space. 
If the time coincides, it is considered that the arrival occurs earlier than the departure.

In your answer, write down two integers separated by a space: first, the maximum number of aircraft that were at the airport at the same time, then the maximum period of time (in minutes) during which there were such a number of transit aircraft at the airport. 

If the plane arrived at 12:00 and departed at 12:01, then it is considered that it stayed at the airport for 2 minutes.

Assignment file
 
Examples
# Input Output
1 6
09:00 10:07
10:20 11:35
12:00 pm 5:00 pm
11:00 11:30
11:20 12:30
11:30 18:15
4 1