There are N different sites for viewing lectures, each of which occasionally carries out technical work. Schedule technical work on each site is known in advance. It is necessary to determine what the maximum time during the day you can watch lectures without a break, perhaps switching lectures all the time for this on different sites.
At the entrance: in the first line the number of sites with lectures N (1 <= N <= 100), and in the next lines - the schedule of technical breaks shown on the sites in the following format: the first number k (1 <= k <= 100) - the number of breaks on the corresponding site, then 2k points in time in the form of HH: MM, separated by spaces - the start point and the end point of the technical pause).
On exit: the maximum time of continuous viewing of lectures for in the format HH: MM.
INPUT
2
1 00:30 01:20
2 00:30 00:40 02:40 02:45
OUTPUT
23:50