Alish, who is tired of this life, is going to Onur and goodbye tonight. Pasha, who is…
- User
Alish, who is tired of this life, is going to Onur and goodbye tonight. Pasha, who is very interested in being a waiter, is a waiter at Dam Dareh and helps Ali. The party starts at 00:00 and lasts until 23:59.
Pasha's duty is that whoever comes to a party or goes out, writes on a piece of paper first that person's name, then the time at that time, and then + or - (where + means he has come and - means he has left) and puts the paper in the bag. . After the party is over, Alish thinks about when the party was the busiest possible time, and since he was not distracted in the middle of the party, he asks this question to Pasha. Pasha, who is a simple waiter, has forgotten everything and only has the information on the papers. On the other hand, he doesn't want to upset Ali and asks you to tell him when your party was the busiest by taking information on the papers. (The number of people in the party at one time is counted after all the ins and outs at that time.)
input In the first line n n number of pieces of paper came then in n The next line contains the name and time and one of the + or - characters.
1 ≤ n ≤ 100
000 1≤n≤100 000
The format of all hours is HH:MM. The name is a string consisting of English lowercase letters. It is guaranteed that the total length of the nouns is maximum 500
000 be 500,000. It is guaranteed that if someone enters the party, he was not in the party before that, and if he leaves, he was in the party before that. output Print the busiest party hour in HH:MM format on the only output line. If there are several answers, print one as desired.
Example Sample entry 1 2 Ali 23:32 - Ali 20:12 + Plain text Sample output 1 21:15 Plain text every hour between 20 : 12 20:12 to 23 : 31 23:31 can also be the answer.
Sample input 2 4 alish 16:15 + Pasha 22:34 - Alish 23:56 - Pasha 21:21 + Plain text Sample output 2 21:33 c++
- Assistant