Head Judge Headache 

You are the Head Judge of the ACM Eastern European Regional Programming Contest. The master Judge computer has been infected by computer virus which has formated the hard disk.

Input 

The first line of the input indicates the number of test cases, and it's followed by a blank line.

For each dataset you have only the listing of submitted problems log formatted as follows:


$Team \_No$($\le$ 25) $Problem \_Letter$(A..G) $Time \_of
\_submittion$(h:mm) $Status \_of \_the \_run$(Y/N)

There's a blank line between datasets.

Output 

Write a program to compute the final standing for each dataset by using the following rules:

Print a blank line between datasets.

Sample Input 

1

1 A 0:50 N
3 A 1:12 Y
2 B 1:19 N
1 A 1:20 Y
2 B 1:35 N
1 B 1:36 N
3 B 1:40 Y
3 C 1:41 N
4 A 1:40 Y

Sample Output 

RANK TEAM PRO/SOLVED TIME
   1    3    2        172
   2    1    1        100
   2    4    1        100
   4    2



Miguel Revilla
2001-01-05