After each contest we want to measure how hard every problem was, using the history of submissions.
For each problem we compute three statistics:
Both averages consider only the teams that actually solved the problem. Following the usual contest rule, the time consumed for a solved problem is the time elapsed from the beginning of the contest until the submission of the accepted run.
Write a program that:
The first line contains an integer n (1 ≤ n ≤ 2000), the number of submissions during the contest.
Each of the next n lines describes one submission and contains, separated by single spaces:
A to I), andA if the submission was accepted, or R if it was rejected.Submissions are listed in nondecreasing order of submission time (equal times are allowed). There are 62 teams competing.
Once a team has an accepted submission for a problem, any further submissions of that same problem by that team may appear in the input but must be ignored in the statistics.
Print exactly nine lines. The first line corresponds to problem A, the second to problem B, and so on through problem I.
For a problem with no accepted solution, print the problem identifier followed by a single 0.
Otherwise print, separated by single spaces: the problem identifier, the number of teams that solved it, the average number of submissions made by those teams, and the average time at which they solved it. Both averages are rounded to two decimal places, rounding a halfway value up (away from zero).