Time limit per test: 0.25
second(s)

Memory limit: 65536 kilobytes

Memory limit: 65536 kilobytes

input: standard

output: standard

output: standard

It's your lucky day - your team took part in the world finals programming contest. The competition has just finished and all competitors are looking forward to the results. Of course your team is not an exception.

According to the rules of the competition, duration of the contest is 5 hours and team standings are frozen during the last hour of the contest — from 241

While waiting for the awards ceremony, your team decided to evaluate chances to win and determine the place which it can take in the final standings. Here is the information that you have:

- Standings table at the end of the 240
^{th}minute

- Total amount of balloons given to all teams within the last hour

- Exact rules of the competition

To solve this problem you should mind the following contest rules:

- The competition lasts for 300 minutes, minutes are numbered from 1 to the 300.

- Position of a team is defined by the amount of the problems solved and penalty time.

- The more problems are solved the higher place a team gets. If two or more teams have the same amount of problems solved, the sorting is done by the penalty time in ascending order (less penalty time — higher place). If two or more teams have the same amount of problems solved and the same penalty time, they share the same place. Rank of a team equals the number of teams performing better + 1. If there are no other teams performing better, the team takes the 1
^{st}place.

- Total penalty time is the sum of the penalty times consumed for each problem solved. The time consumed for a solved problem is the number of a minute (i. e. an integer between 1 and 300) when the correct submission was made plus 20 penalty minutes for every previously rejected run for that problem. There is no penalty time for a problem that is not solved.

- When solution for a particular problem is accepted, a team is not allowed to submit solutions of the same problem anymore.

Frozen standings are given to you in a text form and look as follows:

- The first line consists of "", "", "", and "" tokens followed by a list of problems identifiers. Every problem identifier is a capital Latin letter 'A'-'Z'. All problem identifiers are different.

- The second and the subsequent lines contain team standings itself. These lines are given to you. in non-descending order of team rank

- Every line contains a place of a team, a name of a team, the amount of problems solved and the result for every problem.

- Every result on a problem is

- character "", if the team didn't submit the problem;
- "", if the problem was not accepted and the team made
*x*unsuccessful submits;

- "", if the problem was accepted and the team made
*x*unsuccessful submits before the accepted run;*x*is always omitted if it equals to 0.

You are given the frozen standings, and your task is to calculate the minimum and the maximum place your team can get after the contest is over.

First lines of each set contain the standings table at the end of the 240

You may assume that the size of the input file is not more than 100 KB.

sample input |
sample output |

Rank Team = Penalty X Y 1 Tarasov SU 3 2 33 + + 2 IMHO 1 1 20 + -1 3 Mozgow SU x 33 1 30. + 3 MiTV 1 30 + -3 5 Opel SU 0 0.. 2 MiTV Rank Team = Penalty A 1 aa 0 0 -1 1 ba 0 0 -8 2 ba |
2 4 1 2 |

Online Contester Team © 2002 - 2010. All rights reserved. |