Easy Task

Time limit1sMemory limit128 MB

Problem

After each contest we want to measure how hard every problem was, using the history of submissions.

For each problem we compute three statistics:

  • the number of teams that got the problem accepted,
  • the average number of submissions made by the teams that solved it, and
  • the average time (in seconds from the start of the contest) at which those teams solved it.

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:

  • reads the history of submissions during a contest,
  • for each problem computes the number of accepted solutions, the average number of submissions, and the average time consumed to solve it,
  • prints the result.

Input

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:

  • the submission time in seconds from the start of the contest (a positive integer, at most 18000),
  • a team identifier (a non-empty string of at most five lowercase letters or digits),
  • a problem identifier (a capital letter from A to I), and
  • the result: A 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.

Output

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).