Contest Simulator

In our programming contests, the scoreboard is an HTML file. From the scoreboard, the coaches want to determine the order in which the problems were solved.

Input

The input consists of multiple lines. The end of the input is signalled by a line consisting of the word END. This line should not be processed. All other lines of input consist of HTML, namely the row of a table. Consider, for example, the following line.

<tr><td align=center>1</td><td align=left>Jane Doe</td><td align=center>1/39</td><td align=center>2/135</td><td align=center>1/221</td><td align=center>1/52</td><td align=center>1/68</td><td align=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td align=center>8/--</td><td align=center>1/34</td><td align=center>7</td><td align=center>687</td></tr>
In a browser, this line is rendered as
1Jane Doe1/392/1351/2211/521/68        8/--1/346687
Columns 3-10 contain the scores for the 8 questions. (You may assume that there are always 8 questions.) If a column is empty (that is, it contains a number of &nbsp;) or contains a pattern of the form d/--, then the question was not attempted or not solved. Otherwise, it contains the pattern d/e, where d is the number of attempts (where the last attempt was successful) and e is the number of minutes after the start of the contest after which the successful attempt was submitted.

Output

For each solved problem, print the time remaining in the contest when it was successfully submitted (you should assume that the contest lasted 5 hours), followed by a tab, followed by the person who solved the problem (padded with spaces), followed by a tab, followed by the problem solved (A, B, ..., or H), followed by a tab, followed by the number of attempts. The solved problems should be printed in the order in which they were successfully solved. You may assume that at each time, at most one problem was solved (so there is no need to break ties).

Sample input

<tr><td align=center>1</td><td align=left>Jane Doe</td><td align=center>1/39</td><td align=center>2/135</td><td align=center>1/221</td><td align=center>1/52</td><td align=center>1/68</td><td align=center>1/118</td><td align=center>8/--</td><td align=center>1/34</td><td align=center>7</td><td align=center>687</td></tr>
<tr><td align=center>2</td><td align=left>John Doe</td><td align=center>1/22</td><td align=center>3/232</td><td align=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td align=center>1/140</td><td align=center>1/83</td><td align=center>1/194</td><td align=center>2/--</td><td align=center>2/43</td><td align=center>4</td><td align=center>774</td></tr>
<tr><td align=center>3</td><td align=left>Ron Burgundy</td><td align=center>1/17</td><td align=center>3/296</td><td align=center>1/--</td><td align=center>3/82</td><td align=center>1/58</td><td align=center>2/196</td><td align=center>2/--</td><td align=center>2/78</td><td align=center>6</td><td align=center>848</td></tr>
END

Sample output

4:43    Ron Burgundy    A       1
4:38        John Doe    A       1
4:26        Jane Doe    H       1
4:21        Jane Doe    A       1
4:17        John Doe    H       2
4:08        Jane Doe    D       1
4:02    Ron Burgundy    E       1
3:52        Jane Doe    E       1
3:42    Ron Burgundy    H       2
3:38    Ron Burgundy    D       3
3:37        John Doe    E       1
3:02        Jane Doe    F       1
2:45        Jane Doe    B       2
2:40        John Doe    D       1
1:46        John Doe    F       1
1:44    Ron Burgundy    F       2
1:19        Jane Doe    C       1
1:08        John Doe    B       3
0:04    Ron Burgundy    B       3