PROGRAMMING:Calculation of penalty time
ICPC / CCPC series competition ranking rules:
1. The number of questions, which is easy to understand, the more the number, the higher.
2. "Time penalty". For the same topic, the less penalty time, the more forward.
The penalty time of each question consists of the sum of the benchmark penalty time and the additional penalty time. When each question is passed, the benchmark penalty time of the question is the difference between the current time and the start time. If the question has been submitted incorrectly before, the additional penalty time of 20 minutes will be added for each failed submission. If the title has not been passed, the error submitted before will not be included in the penalty. If the title has been passed, the subsequent submission, whether correct or not, will not be included in the penalty time.
Now, given a series of submitted data, please calculate the penalty time
###Input format:
Give a number n, which means n submissions( 0<=N<= 100000)
Next N lines, each line is separated by three numbers a B C with spaces
A number, indicating the question number (0 < = a < = 1000000);
B is 0 or 1, indicating whether the current topic is passed in this submission, and 1 means passed;
C is the time of the current submission (i.e. the difference from the start time of the competition), in minutes( 0###Output format:
The total penalty time.
###Input example:
```in
three
1 1 10
2 1 20
3 1 30
```
```in
seven
1 0 10
1 1 15
2 0 20
3 1 30
2 0 50
2 1 100
2 0 200
```
###Output example:
```out
sixty
```
```out
two hundred and five
```
answer:If there is no answer, please comment
1. The number of questions, which is easy to understand, the more the number, the higher.
2. "Time penalty". For the same topic, the less penalty time, the more forward.
The penalty time of each question consists of the sum of the benchmark penalty time and the additional penalty time. When each question is passed, the benchmark penalty time of the question is the difference between the current time and the start time. If the question has been submitted incorrectly before, the additional penalty time of 20 minutes will be added for each failed submission. If the title has not been passed, the error submitted before will not be included in the penalty. If the title has been passed, the subsequent submission, whether correct or not, will not be included in the penalty time.
Now, given a series of submitted data, please calculate the penalty time
###Input format:
Give a number n, which means n submissions( 0<=N<= 100000)
Next N lines, each line is separated by three numbers a B C with spaces
A number, indicating the question number (0 < = a < = 1000000);
B is 0 or 1, indicating whether the current topic is passed in this submission, and 1 means passed;
C is the time of the current submission (i.e. the difference from the start time of the competition), in minutes( 0
The total penalty time.
###Input example:
```in
three
1 1 10
2 1 20
3 1 30
```
```in
seven
1 0 10
1 1 15
2 0 20
3 1 30
2 0 50
2 1 100
2 0 200
```
###Output example:
```out
sixty
```
```out
two hundred and five
```
answer:If there is no answer, please comment