Олимпиадный тренинг

Задача 21837. your game


Задача

Темы:

In the intellectual show "Your Game" 3 people are involved. They are given 5 topics, each containing 5 questions worth 100, 200, 300, 400 and 500 points. If the player correctly answers the question, then the cost of the question is added to his current amount, but if he makes a mistake, then the cost of the question is subtracted from his amount. In this case, the player may have a negative amount of points.

Unfortunately, the program that calculates the number of points accidentally self-destructed. You need to write your own program, otherwise the superfinal will not take place.

Input data format

The first line contains three sequences of characters separated by a space — the names of the participants. The name starts with a capital letter, the rest of the letters are lowercase. The participant's name contains no more than 10 and no less than 2 letters, all letters are Latin.

The following lines contain information about the question played. First comes the name of the participant who answered the question, and after a space — the score they received. If the number of points is positive, then the answer turned out to be correct; if it is negative, then the player was mistaken. It is guaranteed that the played number of questions of each cost (100, 200, 300, 400 and 500) does not exceed 5. It is also guaranteed that at least one question will be played during the game.

The last line contains the inscription "GAME OVER", meaning that the game is over and there will be no more questions.

Output format

For each line of input describing the question played, you need to print 3 numbers: the scores of the players after the question was played. The scores must match the players in the order of their names in the first line of the input.

Input:

Artur Dmitry Fedor
Artur-500
Dmitry 400
Fedor 100
Artur 400
Fedor 200
Fedor 100
Artur 500
GAME OVER

Conclusion:
-500 0 0
-500 400 0
-500 400 100
-100 400 100
-100 400 300
-100 400 400
400 400 400